[Tutor] I need advice.

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Tue Aug 2 07:41:58 CEST 2005



On Mon, 1 Aug 2005, Nathan Pinno wrote:

> I want to write a program that will convert time in any other time zone
> to my time zone. Would it be better to use the Python time molecule or
> just a whole bunch of if statements?

Hi Nathan,

I'd recommend looking at the 'datetime' Python module.  Getting this stuff
right is hard, so unless you really want to learn how time conversions
work, take advantage of the library.  There's something there that does do
time zones:

    http://www.python.org/doc/lib/datetime-tzinfo.html
    http://www.python.org/doc/lib/tzinfo-examples.txt

Good luck!



More information about the Tutor mailing list