Get Data By Current Day (With Timezone Knowledge)
The app I am building needs to query data from specific days, relative to the user's timezone. (I assume this is a common need).
Thus far, I am using XANO's timestamp_epoch_day filter to be able to do this - however the data is queried relative to the UTC day, and not from user's start of day (ending at midnight) relative to their timezone.
To do this I would need to incorporate the user's Timezone or Offset which I can send from the frontend (draftbit). Is there a good way to handle this in Xano? I have yet to find a way - but I assume there is a best practice here. Thank you!
Answers
-
@Michael Udinski Any insight you have here would be amazing. Thanks!
-
@Mark if you can send the user's timezone from the front end, then why not send the start date - end date (in UTC) from the front end and get the data from xano based on that.
-
@nocodetalks is on the right track - you need the context, what is the user's timezone, or a reasonable time zone that is not UTC? Either you want to use a single, common time zone that has more meaning to the target audience, such as America/New_York, or you need the user to send their time zone. You could infer a timezone based on the source IP (google has an API for this) but that's not very accurate.
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