Retrieve current date using users time zone from front end
Options
Orbiter
Member ✭
What is the easiest way to retrieve the CURRENT DATE from Xano using a User's timezone?
Best Answer
-
The trick is getting the user's timezone. Either you need the user to select a timezone, or you can infer it from the request from the user by making the timezone part of your request. Depending on your platform, you can get the timezone from javascript with the following expression:
Intl.DateTimeFormat().resolvedOptions().timeZone
(try it in the console of your web browser using dev tools!)
Answers
-
This easiest way is applying the
format_timestamp
filter tonow
You can find the details here: https://docs.xano.com/working-with-data/data-type-filters/timestamp-filters
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