开发者

How to handle the different timezone in mysql?

开发者 https://www.devze.com 2023-03-19 12:07 出处:网络
user login from india at 9:00 am other user from usa at other time. how handle this if both the user having same server开发者_开发问答 but login from different timezoneYou haven\'t really told us wha

user login from india at 9:00 am other user from usa at other time.

how handle this if both the user having same server开发者_开发问答 but login from different timezone


You haven't really told us what your problem is, but the best way to handle multiple timezones is to always store your timestamps in UTC, and convert from local to UTC on insert, and from UTC to local for display.


You could store timezone offset for each user (make the user select one timezone when he creates the account) and do the transformations based on that

0

精彩评论

暂无评论...
验证码 换一张
取 消