[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
- Flutter OAuth2 webAuth Bug?
I created with flutter an app where I can login in with my Microsoft Account. When I compile it to Web (WASM) or Android (aab) then there is no problem what so ...
- SELF HOSTING ISSUE, DATA NOT MIGRATING T...
Hey, devs, I recently tried to migrate my cloud instance to a self hosted version but my data is not transferred fully only the table structure is transferred ...
- No Document ID?
Hi I have a self hosted appwrite. My documents get a document ID but are not visible in the console. I don't know why this happens and how to fix this