开发者

How do Social Networking applications convert server time according to viewer's timezone

开发者 https://www.devze.com 2023-03-21 23:54 出处:网络
How to convert the UTC time according to viewer\'s timezone? I heard that it\'s not possible to get the timezone of the viewer, but then ho开发者_运维技巧w do social networking services like FB, twi

How to convert the UTC time according to viewer's timezone?

I heard that it's not possible to get the timezone of the viewer, but then ho开发者_运维技巧w do social networking services like FB, twitter do this ?

Edit: I have registered users on my application.


  • It is possible to get the user timezone, but this is done with javascript (get the detect_timezone.js). You most likely do that when users are registered.

  • Another, worse way is to approximate the timezone based on the IP

  • and finally (with combination of any of the above), you can give the user a choice to select his timezone in his settings

0

精彩评论

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