Dealing with timezones in PHP

Few months ago we spent some time thinking about this. The technique we ended up with is pretty simple:

  1. Store dates in GMT/UTC (e.g. 0 timezone offset).
  2. Apply current user timezone offset after retrieval from the database (e.g. before showing to the user or whenever you want).

We use Unix timestamps format. But that doesn’t matter.

Leave a Comment