-1

Any best strategy to implement TimeZone for an existing application.

because, there will be many places using updatedBy, createdBy etc..Any good

design pattern to make it easy to implement

Cork Kochi
  • 1,783
  • 6
  • 29
  • 45

1 Answers1

3

Store UTC time, provide UTC time, let client convert it to whatever time zone they deem fit (if that is a browser for example, they can use the browsers timezone).

john16384
  • 7,800
  • 2
  • 30
  • 44
  • So the UTC time has to be passed for all requests ? – Cork Kochi Mar 15 '17 at 15:44
  • 1
    Not necessarily, they can pass the time with a valid time zone (I suggest standardizing on iso 8601), as long as you store it in UTC (you'll have to convert it of course) and return it as UTC. – john16384 Mar 15 '17 at 15:48
  • And for "time zone", use a real [time zone name](https://en.m.wikipedia.org/wiki/List_of_tz_database_time_zones) in form of "continent/region" such as `America/Montreal`, **never the 3-4 letter abbreviations** like `IST`, `EST`, etc. – Basil Bourque Mar 15 '17 at 19:48