This project shows different ways of working with time/timestamps using the web viewer. Keep your time in seconds (as it really should be) and format it for the user only when needed! AND format in your preferred way! ON THE FLY!
https://x.thunkable.com/projectPage/61e8895b1943bc0010bf7b86
It allows you to use any formatting string available here
Skys the limit!
The basic idea here is to pass “seconds since 1970” values and a format to the webviewer and to receive back a formatted version of that time stamp.
Why’s this useful?
It’s important to know that “seconds since 1970” or a “time stamp” is how most computers think about time. And what’s more, they’re all in sync. What happens on the client side is that these timestamps are converted to a date string by some fancy algorithms that take into account the seconds value plus your local timezone.
You can do a lot once you don’t rely on being able to actually read the timestamp.
you can:
Compare 2 dates
add time to a date
find if 1 duration overlaps or is contained by another duration.
find durations of time between dates/times
and more!