On Mon, Aug 18, 2014 at 11:53 AM, Ian Kelly <ian.g.ke...@gmail.com> wrote: > On Mon, Aug 18, 2014 at 7:12 AM, luofeiyu <elearn2...@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. -- https://mail.python.org/mailman/listinfo/python-list