[Tutor] Processing unix style timestamp

Alan Gauld alan.gauld at btinternet.com
Fri Mar 7 10:43:41 CET 2008

"John Fouhy" <john at fouhy.net> wrote

> You should be able to parse the former with strptime().  You could
> then build a dictionary mapping timezones to offsets which you could
> add to the parsed time to produce a time in GMT.

Just to point out that to do this accurately is incredibly difficult.

There are places which change timezone over the year. Places
where the timezone differences vary over the year (from whole
hours to fractions of an hour etc) and the dates of DST vary from
country to country and in some cases from region to region within
countries (The former USSR for example). And in small
countries it can vary on a whim of the government (I was once
on a skiing holiday in Andorra where they delayed the DST
change by a week to help preserve the snow cover!! It was
announced on local radio and a statutory nortice posted in
all hotels and public buildings!)

Managing tracking of times across multiple timezones around
the world was one of the hardest design challenges I ever faced!

Alan G. 

More information about the Tutor mailing list