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


Groups > comp.lang.python > #76500

Re: How to look up historical time zones by date and location

References (1 earlier) <85mwb24h9o.fsf@benfinney.id.au> <53F1875F.4020109@gmail.com> <CAPTjJmrxAox15ZKSNR5HtbFJSBukK7GwKH91itLid8cNE8Nvsg@mail.gmail.com> <53F1FBCC.6060406@gmail.com> <CALwzidkdnS1X7t=+gXsL_t+UcnhY+QvL_Gyj8Dgfc2uzhJM4Pw@mail.gmail.com>
From Ian Kelly <ian.g.kelly@gmail.com>
Date 2014-08-18 12:11 -0600
Subject Re: How to look up historical time zones by date and location
Newsgroups comp.lang.python
Message-ID <mailman.13108.1408385550.18130.python-list@python.org> (permalink)

Show all headers | View raw


On Mon, Aug 18, 2014 at 11:53 AM, Ian Kelly <ian.g.kelly@gmail.com> wrote:
> On Mon, Aug 18, 2014 at 7:12 AM, luofeiyu <elearn2014@gmail.com> wrote:
>>
>> I found that it is a concept LMT local mean time can express my meaning.
>>
>> import pytz,datetime
>> tz1 = pytz.timezone('Asia/Shanghai')
>> tz1
>> <DstTzInfo 'Asia/Shanghai' LMT+8:06:00 STD>
>> >>> str(tz1)
>> 'Asia/Shanghai'
>>
>> tz2 = pytz.timezone('Asia/Urumqi')
>> tz2
>> <DstTzInfo 'Asia/Urumqi' LMT+5:50:00 STD>
>>
>> the time difference between shanghai and Urumqi is about 2 hours in the form of LMT.
>>
>> now ,how can i get the output of `LMT+8:06:00` in <DstTzInfo 'Asia/Shanghai' LMT+8:06:00 STD>
>>
>> str(tz1) or str(tz2) can not do that.
>
> By working with dates far enough in the past that the modern time zone
> rules don't apply. Some experimentation determines that the timedelta
> between Shanghai and Urumqi goes from 136 minutes to 120 minutes in
> 1928, and then from 120 minutes to 0 minutes in 1980. I don't know why
> those dates don't match the dates given by Wikipedia in [1], and I
> also don't know why pytz shows the LMT offset in the repr for those
> timezones instead of the current UTC offset.
>
> [1] http://en.wikipedia.org/wiki/Time_in_China

Or if you really just want to work with the unofficial Xinjiang time,
then I'd suggest simply constructing a datetime.timezone for UTC+6.

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


Thread

Re: How to look up historical time zones by date and location Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-18 12:11 -0600

csiph-web