Get a user's timezone in Python + Pylons
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:
- use Javascript:
Date.getTimezoneOffset();
- use geolocation to determine where the user is located and deduce the timezone from the location
精彩评论