Timezone

Tim Daneliuk tundra at tundraware.com
Sun Jul 29 21:10:02 EDT 2001


Tim Daneliuk wrote:
> 
> Richard van de Stadt wrote:
> >
> > I run stuff on systems in various timezones.
> > I need to display when certain files have been updated.
> > ctime (time()) shows the current date and time, but without the timezone
> > that you get to see e.g. by Unix' date command.
> >
> > Is there a (Python) way to find out the timezone?
> >
> > Richard.
> 
> import time
> 
> time.tzname
> 
> ...will return a tuple containing the strings which name the timezone
> 
> time.timezone
> 
> ...will return the offset from UTC in seconds
> 
> --
> ------------------------------------------------------------------------------
> Tim Daneliuk
> tundra at tundraware.com

Actually, this raises an interesting question, which perhaps the resident geniuses
can 'splain to me.  Here in Chicago, we're currently 6 hourse or 21,600 sec *behind*
UTC.  Why does time.timezone return 21600, not -21600?  It seems that for
arithmetic reasons, you'd want to know both the magnitude and direction of
this vector...

Inquiring minds wanna know ;)
-- 
------------------------------------------------------------------------------
Tim Daneliuk
tundra at tundraware.com



More information about the Python-list mailing list