[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
- API key not having access to database
My api key with read and write access to row and tables and DB I not working. In my test the results returned an empty database. This is the second time I am...
- How to bypass the rate limit on the back...
Once a month my app has a ton of usage and I always run into the Too many requests 429 error. I am trying to optimize the queues and jobs to manage that, but a...
- [SOLVED] Appwrite Cloud and FRA cloud se...
Can anyone estimate how long this will take to resolve? I am checking status here https://status.appwrite.online/