[SOLVED] How to query documents using a date field, having in consideration timezones?
- 0
- Databases
- Flutter
Lets say I save a document at 05:00 am GTM-6 on feb 01, it will be saved in the database in UTC as 23:00 of January 21, If I query my documents of Feb 01, that specific document wont appear, is there a way to handle this?
I'd guess the best way is to do a between query. Query.greater() AND Query.less()
You'll need to make the proper index for it, but that should do the trick. You just need to calculate the beginning and end of the timezone's day.
When you query using listDocuments() the query parameter is a list of queries that are AND-ed together, so you just need both those greater and less queries in there.
Thank you very much tanner π
Do you mind marking this [SOLVED] in the title?
[solved How to query documents using a date field, having in consideration timezones?
[SOLVED] How to query documents using a date field, having in consideration timezones?
Recommended threads
- Update row sheet not loading
After right clicking a row header and click update, the sidebar fails to load (never-ending skeleton)
- Bug report: Race condition in Flutter SD...
Hi team, I've found an intermittent bug in the Flutter SDK (v20.3.0) when using `createOAuth2Session` on Android. **Symptoms** After `createOAuth2Session` re...
- DB Relational Table Request
Hi, I'd like to suggest a rewording of the relationships between tables. - Current wording: storeOperatingDays can contain one storeId ...