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

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <ian.g.kelly@gmail.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.029
X-Spam-Evidence '*H*': 0.94; '*S*': 0.00; 'output': 0.05; 'skip:` 10': 0.07; 'subject:How': 0.10; 'suggest': 0.14; '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; "i'd": 0.34; 'received:google.com': 0.35; 'really': 0.36; '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; 'ian': 0.60; 'simply': 0.61; '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=UnivYXAp1QfKTPWctbp+SaDz+gYX1mAYWiWxBKmB2TM=; b=wZyYRwdZL88bYnD4GFHxsoSrsFlpvAEiOZZOvZ169vOLsFcZiHwANbiFpM64+i0mYS fb7nNvyBSthNzcb3SNkZ6PmQoKeKpPJ11weWpEIR6H/FRLnk+2bEbMQd4QUrls3xC5et tgMzd0Y/5Xwy2BNTrG0tEXv9wW7KiNwWVMpP4UiNYnJ3ASdkBmtwnDAZcvErrPuz4YxI TOzw5JPIPqbhQcYUhsX4xS3mRAG1k8JGvlyliM/RWV9SyvfpOUZ7Yv7XQPUS/s99cBUL 2kjvMjfjYXK0v5Xu9tEePrHY6UwNDr6CPjpCbZsdhjgQYrxGYHKvMN1QnnCPL9JrwLNh D+LQ==
X-Received by 10.70.137.98 with SMTP id qh2mr32300047pdb.61.1408385546683; Mon, 18 Aug 2014 11:12:26 -0700 (PDT)
MIME-Version 1.0
In-Reply-To <CALwzidkdnS1X7t=+gXsL_t+UcnhY+QvL_Gyj8Dgfc2uzhJM4Pw@mail.gmail.com>
References <53F14971.3010209@gmail.com> <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 Mon, 18 Aug 2014 12:11:46 -0600
Subject Re: How to look up historical time zones by date and location
To Python <python-list@python.org>
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 <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.13108.1408385550.18130.python-list@python.org> (permalink)
Lines 34
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1408385550 news.xs4all.nl 2855 [2001:888:2000:d::a6]:43106
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:76500

Show key headers only | 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