[Chicago] Working with timezones

Bill Seitz fluxent at gmail.com
Fri Nov 18 16:02:18 EST 2016


You want libraries that build on the Olson/tz/IANA system. That will lead
you down the happy path.

On Nov 18, 2016 2:43 PM, "Suchandra Thapa" <suchandra+chipy at gmail.com>
wrote:

> If you need to implement this yourself, just be sure to consider that this
> is dependent on the date as well.  I.e. depending on when daylight savings
> time goes into effect, your timezone names will change.  To be really
> accurate, you'll need the year as well.
>
> Suchandra
>
> On Fri, Nov 18, 2016 at 2:33 PM Chris Foresman <foresmac at gmail.com> wrote:
>
>> Ugh, dealing with time/timezones is the worst, AMIRITE? Here’s what I
>> need to do:
>>
>> Calculate an offset from UTC, and use the offset to get a list of
>> corresponding timezone names, i.e., I’ve detmerined that I need all the
>> timezones associated with offset -06:00; which includes “America/Chicago”,
>> “CT”, etc. I looked at pytz, but it looks like it only goes the other
>> direction, i.e. pytz.timezone(‘America/Chicago’) will give me a tzinfo
>> instance with UTC offset -06:00.
>>
>> Outside of building my own reverse database, does anyone have ideas how
>> to make this work?
>>
>>
>> Thanks,
>> Chris Foresman
>> foresmac at gmail.com
>>
>>
>>
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> https://mail.python.org/mailman/listinfo/chicago
>>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> https://mail.python.org/mailman/listinfo/chicago
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20161118/436a1f99/attachment-0001.html>


More information about the Chicago mailing list