开发者

Get a user's timezone in Python + Pylons

开发者 https://www.devze.com 2022-12-24 08:45 出处:网络
Is there a way to get th开发者_开发问答e timezone of the connecting user using Pylons, and to adjust the content before rendering accordingly?Or can this only be done by JS?

Is there a way to get th开发者_开发问答e timezone of the connecting user using Pylons, and to adjust the content before rendering accordingly? Or can this only be done by JS?

Thanks.


You can't get the client's timezone using server-side code, you can, however:

  1. use Javascript: Date.getTimezoneOffset();
  2. use geolocation to determine where the user is located and deduce the timezone from the location
0

精彩评论

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