Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6062

Re: Python 2.6 and timezones

References <46c24750-ac9b-4d75-835c-5403ff2ea959@d28g2000yqf.googlegroups.com>
Date 2011-05-23 21:48 +1100
Subject Re: Python 2.6 and timezones
From Daniel Kluev <dan.kluev@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1971.1306147689.9059.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, May 23, 2011 at 9:32 PM, loial <jldunn2000@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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Python 2.6 and timezones loial <jldunn2000@gmail.com> - 2011-05-23 03:32 -0700
  Re: Python 2.6 and timezones Daniel Kluev <dan.kluev@gmail.com> - 2011-05-23 21:48 +1100
    Re: Python 2.6 and timezones loial <jldunn2000@gmail.com> - 2011-05-23 04:56 -0700
      Re: Python 2.6 and timezones Daniel Kluev <dan.kluev@gmail.com> - 2011-05-23 23:33 +1100

csiph-web