If this is interesting for somebody....

I just play with timezones problem, with python pytz library and with 
javascript Date.prototype.getTimezoneOffset().
>From pytz I know that there aren't 24 timezones (as was my first idea), but 
73 (at first look there are 61 zones based on offset in summer and in 
winter - but 73 if we check when standard/dst times changes).
Time offsets from UTC are -11...+14 (means there are places in Pacific, 
where is same local time but different date).

Date.prototype.getTimezoneOffset() returns different offset in summer and 
in winter (of course where dst applies).
dst offset is always higher (usually but not always +1:00) then standard 
time.
>From that reason:
If January time has a smaller offset as Jule time we are on the north 
hemisphere,
If January time has a larger offset as Jule time we are on the south 
hemisphere.

It looks like jstz converts "january" and "jule" offsets from 
.getTimeZoneOffset(), with some corrections, to zones names.
There are 72 timezones in jstz.olson.timezones, which doesn't respond (I 
think) to that 73 from pytz, but does respond to that 61 from pytz.
I think that's because jstz is not necessary interested when standard/dst 
times changes.
It has more timezones (72) as pytz (61) because the number from pytz I 
received for the year 2015. But jstz has some history (in my version 
2008-2014) and maybe some timezones collapsed through the time into same 
behaviour in 2015.

I want have events callendar in the application and need register the user 
with his proper timezone.
I think the best approach will be
1) from pytz identify 73 different timezones and generate them into html 
<select>,
2) based on jstz preselect in javascript users timezone.

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to