Back

Query on Datetime attribute by server time

  • 0
  • Databases
  • REST API
  • Self Hosted
  • Cloud
xmmk
2 Apr, 2024, 13:33

Is there a way to query database documents by the server time (e.g. "now()")? Querying by the client time (e.g. Datetime.now()) seems a bit unreliable and is not useable where the current time really matters, like expiration dates.

TL;DR
Developers are discussing the best practice for saving datetimes in the database. They are debating whether to save datetimes in UTC or convert local time to UTC before saving. There is a query about how to retrieve database documents by the server time (e.g. "now()") rather than the client time (e.g. Datetime.now()) for cases where current time accuracy is crucial.
ideclon
2 Apr, 2024, 13:40

No. Although you proxy through a Function?

Kenny
2 Apr, 2024, 13:50

Should you save datetimes in your DB as UTC and convert local time to UTC?

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more