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


Groups > comp.lang.python > #76499

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

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

Show all headers | View raw


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

Back to comp.lang.python | Previous | NextNext in thread | 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 11:53 -0600
  Re: How to look up historical time zones by date and location pecore@pascolo.net - 2014-08-18 21:47 +0200
  Re: How to look up historical time zones by date and location Grant Edwards <invalid@invalid.invalid> - 2014-08-18 21:14 +0000
    Re: How to look up historical time zones by date and location luofeiyu <elearn2014@gmail.com> - 2014-08-19 09:31 +0800
    Re: How to look up historical time zones by date and location luofeiyu <elearn2014@gmail.com> - 2014-08-19 09:00 +0800
    Re: How to look up historical time zones by date and location Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-19 10:25 -0600
      Re: How to look up historical time zones by date and location Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-19 17:44 +0000

csiph-web