Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76500 > unrolled thread
| Started by | Ian Kelly <ian.g.kelly@gmail.com> |
|---|---|
| First post | 2014-08-18 12:11 -0600 |
| Last post | 2014-08-18 12:11 -0600 |
| Articles | 1 — 1 participant |
Back to article view | Back to comp.lang.python
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
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
| 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 |
| Message-ID | <mailman.13108.1408385550.18130.python-list@python.org> |
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 top | Article view | comp.lang.python
csiph-web