Reputation: 138
I'm struggling with a simple check of a date in firestore. I save a serverTimestamp object to the database.
Now I want to check if this date is older than 23h, without using a local date object, because that could be modified by the user or have a different timezone.
Can someone help me with this, cant find anything useful so far.
Thx a lot.
Upvotes: 0
Views: 286
Reputation: 598623
Unfortunately there is no way to use a server-side timestamp as the value in a query.
The closest you can get is using a local date/time from the client and then validating that in the security rules of your database.
Also see:
Upvotes: 1