ISO with timezone

nik nikbaer at
Tue Jan 29 03:03:09 CET 2008


How does one express the time in ISO format with the timezone

what I want is YYYY-MM-DDThh:mm:ss.sTZD

>From the documentation I see:
>>> from datetime import tzinfo, timedelta, datetime
>>> class TZ(tzinfo):
...     def utcoffset(self, dt): return timedelta(minutes=-399)
>>> datetime(2002, 12, 25, tzinfo=TZ()).isoformat(' ')
'2002-12-25 00:00:00-06:39'

and I've also figured out:

But can't figure out how to fit them together.

Thank you,

More information about the Python-list mailing list