Update field to Xano timezone
Options
JJ
Member ✭
Hi,
I have an app that is global, so users have different timezones. I made a table "user" with their data and the respective timezone. How can I build a function that will update the timestamp field from the user timezone to xano timezone?
Thank you very much in advance.
I have an app that is global, so users have different timezones. I made a table "user" with their data and the respective timezone. How can I build a function that will update the timestamp field from the user timezone to xano timezone?
Thank you very much in advance.
Comments
-
Hi JJ,
A timestamp is an absolute value. It's not timezone dependant. It's the number of milliseconds between january 1st 1970 UTC and the specified UTC date-time.
Therefore, you can provide an ISO 8601 date-time string (including the timezone) to Xano to get the relevant timestamp.
You should read this page. It's probably clearer than my explanation
https://docs.xano.com/working-with-data/timestamp -
thanks, I know timestamp is not timezone dependant, but my issue is if I want to add let's say a datetime data from external app to XANO DB and then compare to XANO "now" timestamp, XANO has to have the "now" in a certain timezone and that is what I need to know/convert to not compare Apples with Oranges.
[image.png] -
The to_timestamp filter lets you specify from which timezone comes your local "now" date-time.
If your date-time is provided in a standard ISO 8601 string format and includes the timezone (for example 2021-01-01T14:00:00-0400), you'll get the correct timestamp.
[image.png] -
Super thank you very much, was able to achieve what I needed with to_timestamp and add_secs_to_timestamp 😃.
Categories
- All Categories
- 53 ? Announcements
- 47 ? Releases
- 37 ? Welcome
- 983 ? Help! I'm a Noob
- 125 ? No-Code Front-Ends
- 633 ? Working with APIs
- 439 ? Transforming data
- 126 ? Connect Xano to ...
- 50 ?? Find an Expert
- 348 ❓Other questions
- 35 ? Security
- 22 ✂️ Snippets
- 19 ? Showcase
- 7 ?️ Xano Chatter
- 62 ? Video Tutorials
- 171 ? Request a feature
- 229 ? Report a Bug
- 19 ? Templates & Extensions
- 7 ? Feedback