Search code examples
datetimetimeutc

Best time format for international audience


Not sure if this is the right forum, but I have an application where a certain time is being shown in Eastern Standard Time (or Daylight Time). There were several suggestions (read complaints) from clients in South America and certain Far Eastern Countries that the time should also be displayed in a well known International standard.

My question is should the time be shown in UTC format for International Audience?


Solution

  • This is a rather broad/opinion-soliciting question. But from an objective standpoint, you really have three core options:

    • Store all datetime info as UTC, and then provide localization on a per-user basis (that is, let the user choose their timezone in their profile, and convert UTC <--> local time whenever dealing with input or displaying dates)
    • Store each user's datetime info as localized, based on the timezone they choose in their profile. Then just deal with input / output of datetime as-is, for that user (meaning, no translation when querying or saving).
    • Pick a single timezone. Then store and display all datetimes as that timezone.

    Timezones are an issue to be dealt with even within a given country (e.g. the USA has 4 timezones). Typically, web properties allow for per-user timezone specification.

    Note: If you store all datetimes consistently (e.g. all UTC), this will likely make your reporting and other database operations more straightforward.