i want to share this one single block of thunkable code that does one thing only: convert a unix time (in seconds since 1970) into a readable date. for example 1655438752 would convert to 2022-06-16 21:05:52 PDT .
you call the routine as shown below:
i live in california which is offset from GMT by -7 hours, hence i can customize the converter to give results in local time.
here’s the project link:
This is super cool
Does this account for leap years and daylight savings time? A timezone is different than an offset.
Leap years, yes. However DST and time zone logic seem difficult to do. Maybe there’s an api you can call at start that returns GMT offset and time zone at your current location. Maybe it can return the human readable date at the same time! Haha!
JS has the function. All what is required is a simple Thunkable block that accepts JS code. That’s it. Tons of issues will get resolved by such block
didn’t you already make this block? you shared this project a couple of months ago.
(i think you do need a webserver that will execute the script)
Yes, but that requires the
web viewer which has its own problems like inability to run as local/packaged code.
This way we do not need to include the