Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!news.stack.nl!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*S*': 0.00; 'output': 0.05; 'skip:` 10': 0.07; 'subject:How': 0.10; 'determines': 0.16; 'repr': 0.16; 'timezones': 0.16; 'utc': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'aug': 0.22; 'rules': 0.22; 'apply.': 0.24; 'mon,': 0.24; 'header:In-Reply-To:1': 0.27; 'skip:p 30': 0.29; '[1]': 0.29; 'am,': 0.29; 'message-id:@mail.gmail.com': 0.30; "skip:' 10": 0.31; 'that.': 0.31; 'url:wiki': 0.31; '120': 0.31; 'url:wikipedia': 0.31; 'subject:time': 0.33; 'received:google.com': 0.35; 'dates': 0.36; 'shows': 0.36; 'url:org': 0.36; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'enough': 0.39; 'skip:p 20': 0.39; 'hours': 0.66; 'minutes': 0.67; 'between': 0.67; 'shanghai': 0.84; 'subject:location': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; bh=w0IMiWU1cAeHgxt8sRbQFsuNHmiWqB3Ysu2zPEhQsF8=; b=MDFh0buz2ANMeDFz1W9wptA4HjUjrhznBgfRpF4MhqiPUvgaNa9W3+RZ6E9yOv3GVd +yPYPy3IjHD1ZIgcUmMSMVzaUNWbKPsktLd0WaTLtmUgO59muh2RTKD7TjRM5TSDHsV6 44MRrpzk70Y+UgV/5I+uYQ4dXKYtOcnYsezMhLzOTh8R8SNm27qafa2WlC6hX6cNjgEb rt5Ug7eGwqdTg6qIYjNA2pDg4rjK1alo3JlqXdTLiuZCOIgzY+5RsCnV5FPoJG/6DfDb 1DPaA1wxdzUCdoS8/w3Fgshody+qOLnMcEyFxy/hCZPUr6F6L8eeBNj48qS0mftHCkne 4QRQ== X-Received: by 10.68.68.131 with SMTP id w3mr37140390pbt.90.1408384436096; Mon, 18 Aug 2014 10:53:56 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: <53F1FBCC.6060406@gmail.com> References: <53F14971.3010209@gmail.com> <85mwb24h9o.fsf@benfinney.id.au> <53F1875F.4020109@gmail.com> <53F1FBCC.6060406@gmail.com> From: Ian Kelly Date: Mon, 18 Aug 2014 11:53:15 -0600 Subject: Re: How to look up historical time zones by date and location To: Python Content-Type: text/plain; charset=UTF-8 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 30 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1408384942 news.xs4all.nl 2841 [2001:888:2000:d::a6]:40298 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:76499 On Mon, Aug 18, 2014 at 7:12 AM, luofeiyu 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 > > >>> str(tz1) > 'Asia/Shanghai' > > tz2 = pytz.timezone('Asia/Urumqi') > tz2 > > > 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 > > 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