Bolin
Bolin

Reputation: 138

Firebase serverTimestamp older than

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.

enter image description here

Upvotes: 0

Views: 286

Answers (1)

Frank van Puffelen
Frank van Puffelen

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

Related Questions