Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Date: store only date data. Should appear the same to everyone regardless of timezone. ex. 1/1/2024.

  • Timestamp/datetime: store an exact timestamp of date and time. ex. 1/1/2024 00:00 UTC. Does not store timezone info, e.g. 1/1/2024 03:00 UTC is NOT distinct from 12/31/2023 23:00 EDT.

The following fields should be date but are grandfathered in as timestamps.

...

Endpoints dealing with timestamps should send as yyyy-mm-ddThh:mm:ss.sssZ or similar. Axios and Express so do this automatically with JS Date objects.

...

A good idea to include manual tests for dates and times that involve times within 4 hours of midnight in either direction to make sure the feature doesn’t mess up the time displayed. Remember that the default timezone is ET, so it should at least work as expected in this time zone.

To debug timezone issues, check the network traffic (browser dev tools > Network) and your local database contents for the way the dates are formatted.