4kir4.1i at gmail.com
Mon Oct 6 03:10:26 CEST 2014
Seymore4Head <Seymore4Head at Hotmail.invalid> writes:
> This is not a new video, but it is new to me.
> Any links to some easy to follow time zone math?
The point of the video is that you should not do it yourself, use
already written tools.
It is quite comprehensive video. Here's how the mentioned issues could
- erratic UTC offset changes by politicians in different countries --
*use UTC timezone* for calculations, in addition (if necessary) store
both the local time and timezone info. *Use pytz module* that provides
access to the tz database to convert between timezones (many people
get it wrong but it is not a rocket science). As said in the video, it
won't help if the rules change a day before the DST transition but at
least most  systems will be consistent. It also doesn't support
some exotic timezone rules such as in Saudi Arabia (sunrise and/or
sunset at the fixed local time every day ) or many timezones before
- julian, gregorian calendars, proleptic UT (past dates): *use proleptic
gregorian calendar (datetime module)* unless you know that you need
otherwise (then you could investigate what JD means in a particular
document given multiple possible interpretations)
- leap seconds (posix, Mills, Windows(ntp), smear (google, java)),
"right" timezones, and the difference between UT1, UTC(BIMP), GPS,
TT(TAI), TCB, etc time scales: *ignore them* unless you know that you
need otherwise e.g., legally elapsed seconds . Here's some pictures
to illustrate the difference between time scales .
More information about the Python-list