Rule of thumb: Think global; Present local

The servers should almost always be set to UTC in their operating system time zone. But in programming, we should never depend on this assumption as everyone can change it. So always specify our desired/expected time zone

Our business logic, database storage, business logic, data exchange, serialization, logging, and even our own thinking should all be done in UTC and 24-hour clock. Then only applying a particular time zone when presenting data to users.

API design

  • Send/receive in ISO-8601: YYYY-MM-DDThh:mm:ss.sTZD (eg 1997-07-16T19:20:30.45+01:00)
  • Accept any timezone: Do not make any assumptions about what timezone your API users will utilize
  • Don’t use time if unneeded