Time zones

T

Timothy Hume

Hi,

I want to ensure that all my time calculations are done in UTC. This is
easy with Python on UNIX machines. I simply set the TZ environment
variable to "UTC", and it ensures that the time functions use UTC.

My question is, how do I get similar functionality using Python on
Windows?

Thanks,

Tim.
 
D

David Bolen

Timothy Hume said:
I want to ensure that all my time calculations are done in UTC. This is
easy with Python on UNIX machines. I simply set the TZ environment
variable to "UTC", and it ensures that the time functions use UTC.

My question is, how do I get similar functionality using Python on
Windows?

If you're just talking about time module functions, I think you should
be able to do the same thing. The time functions are overlays for the
C library versions which do use tzset() and look at the TZ environment
variable as under Unix.
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.Wed Dec 01 17:42:08 2004
TZ=UTC py24
Python 2.4 (#60, Nov 30 2004, 11:49:19) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.Wed Dec 01 22:42:21 2004


(I've used 2.4 here, but the same results work back until 1.5.2)

-- David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,212
Messages
2,571,102
Members
47,698
Latest member
TerraT521

Latest Threads

Top