Friends in need
Random Quote
Without you, day is nothing but a waste of light.
- Seabound (Without you)

If you, as a system developer or product owner, have to handle timestamps in your system, you have to think about a few things. Especially if you plan to show your users these timestamp values.

  1. If you decide to not use UTC everywhere, think again.
  2. If you still want to use other time zones than UTC, please, take a walk around the block, and then reconsider your decision, by reading about pros and cons with time zones.
  3. Okay, if you are sane, but still want to throw yourself into the time zone mud, you can at least consider the following:
    • Are you going to store all your timestamps in UTC, otherwise think again. (With all I mean exactly all, not most, not some, not the majority.)
    • Are you going to show your users any of your timestamps without explicit time zone information, think again. Or better yet, never do this.
    • When using different time zones, please skip the useless abbreviations (eg CET, EST, IST). Also avoid to only use identifiers (eg Europe/Stockholm, America/Los_Angeles), since they lack actual offset information. Make sure to always include correct offset information.

Conclusions

If you use UTC everywhere your life will be a walk-in-the-park. The other paths may be dark and cumbersome and you have been warned.

First published by Anders Gustafson 2018-09-01