On 21 Dec 2005 03:15:47 -0800, Narendra < [EMAIL PROTECTED]> wrote:
Hi All,

i got a problem. I need to convert time from EST standard to PST
standard.

Thu, 15 Dec 2005 09:24:19 -0500 to PST

Quick and dirty,   might not work for times at the end of DST

>>> import time
>>> from email import Utils

>>> def tconv(t):
...     t1 = Utils.mktime_tz(Utils.parsedate_tz(t))
...     return time.ctime(t1 -(8*60*60)) + ' -0800'

>>> tconv('Thu, 15 Dec 2005 09:24:19 -0500')
'Thu Dec 15 06:24:19 2005 -0800'


Failing that,  google for "python converting timezones"

HTH :)
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to