views:

119

answers:

1

Is there a way to get the timezone of the connecting user using Pylons, and to adjust the content before rendering accordingly? Or can this only be done by JS?

Thanks.

+2  A: 

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
Can Berk Güder
These methods are your best guess, but they're still wildly unreliable, so it's always best to provide explicit configuration options if times are important. See `pytz` for timezone conversions.
bobince
@bobince: true.
Can Berk Güder