Rank 2: Process
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?
Votes
0
Replies
7
Participants
Unknown
Messages
8
Rank 2: Process
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.
Rank 2: Process
Thank you very much tanner 😄
Do you mind marking this [SOLVED] in the title?
Rank 2: Process
[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?