How does one deal with multiple TimeZones in applications that store dates and times?

后端 未结 6 1589
轻奢々
轻奢々 2020-12-18 08:50

I realize this is a bit subjective, but I\'m hoping to pick everyones brain here on how they deal with multiple timezones? There are a variety of similar questions here and

6条回答
  •  北海茫月
    2020-12-18 09:05

    You need to maintain the user timezone information and all time zone information. And always store the time in UTC.And when you want to display that information to particular user then just access this user's timezone(which is stored for this user) and add or subtract that amount of time from the time stored in UTC and display this.That will be in the timezone of the user who is viewing the information.

提交回复
热议问题