Python 2.6 and timezones

Daniel Kluev dan.kluev at gmail.com
Mon May 23 06:48:05 EDT 2011


On Mon, May 23, 2011 at 9:32 PM, loial <jldunn2000 at gmail.com> wrote:
> Does python have an equivalent of the java Timezone object?
>
> I need to be able to get offsets for timezones (only U.S. time zones
> at the moment)

Depends on what exactly do you want. If you need to convert timezone
name into current offset, you should use [1] or [2].
If you just need to handle known offsets for datetime objects, there
is tzinfo class in datetime module, [3].


[1] http://pypi.python.org/pypi/PosixTimeZone/0.9.4
[2] http://pypi.python.org/pypi/pytz/2011g
[3] http://docs.python.org/library/datetime.html#tzinfo-objects

-- 
With best regards,
Daniel Kluev



More information about the Python-list mailing list