[Tutor] can time.time() be reversed so as to get date?

Alan Gauld alan.gauld at btinternet.com
Sat Nov 7 01:54:33 CET 2009


"Dave Angel" <davea at ieee.org> wrote

> GMT, and you want GMT for the final date & time.  If you do convert to 
> local time and back, you risk getting two kinds of errors:
>    1) the time zone known to the system may differ from the one you 
> have using the magic number 330, especially when the system changes to 
> daylight savings time, and you forget to adjust your value.
>    2) There is an hour of time in the fall or spring (I think it's in 
> the fall) when a UTC time cannot be unambiguously represented as local 
> time.  

There are a myriad of problems involved in working with time zones.
I once had an undergraduate student on summer vacation do a study 
on it for me and he produced a paper of over 100 pages documenting 
something like 30 different issues he had uncovered. Most of those 
issues are still valid today some 15 years later.

If you are working in one timezone its not too bad (although that 
depends on which one!) but even then there are issues like the 
daylight savings switchover - when 1:30am can come after 1:45am!

And if you include local geographical and political factors it 
gets impossible. There is somewhere in the Pacific where the same 
street has two different timezones and the local government there
have chosen a different date to implement DST from everywhere 
else in either of the timezones! I once went on hioliday to a small 
European country where they delayed DST by a week because 
it would have spoiled the skiing! This was announced on public radio 
on the Wednesday before the clocks were due to change! How is a 
computer system supposeed to deal with that kind of arbitrary behaviour?!

And finally we represent times using a discrete numbering system 
but it is an essentially analog quantity with an arbitrary baseline, so 
there are always opportunities for error and inexactitude, especially 
with small values.

rant over,

Alan G.



More information about the Tutor mailing list