Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #96536
| Path | csiph.com!usenet.pasdenom.info!news.redatomik.org!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!nzpost1.xs4all.net!not-for-mail |
|---|---|
| Return-Path | <tim.peters@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.003 |
| X-Spam-Evidence | '*H*': 0.99; '*S*': 0.00; 'subject:: [': 0.03; 'anyway.': 0.04; 'sufficient': 0.05; '(of': 0.07; 'dst': 0.07; 'cc:addr:python-list': 0.09; 'creighton': 0.09; 'cc:addr:lac': 0.16; 'cc:addr:openend.se': 0.16; 'cc:name:laura creighton': 0.16; 'relatives': 0.16; "wouldn't": 0.16; ';-)': 0.18; 'subject:] ': 0.19; 'cc:addr:python.org': 0.20; 'cc:2**2': 0.20; 'ones.': 0.22; 'subject:skip:i 10': 0.22; 'seems': 0.23; 'cc:addr:gmail.com': 0.24; 'header:In-Reply-To:1': 0.24; 'question': 0.27; 'message- id:@mail.gmail.com': 0.27; 'arrival': 0.29; "they'll": 0.29; 'train': 0.30; 'rules': 0.31; 'knows': 0.32; 'skip:d 40': 0.32; '"")': 0.33; 'schedule': 0.34; 'except': 0.34; 'skip:d 20': 0.34; 'received:google.com': 0.35; 'but': 0.36; 'too': 0.36; 'subject:" ': 0.36; 'subject:?': 0.36; 'beyond': 0.37; 'anything': 0.38; 'expressed': 0.39; 'subject:-': 0.39; 'to:addr:python.org': 0.40; 'more': 0.63; 'canadian': 0.66; 'subject:there': 0.66; 'subject:any': 0.84; 'traveler': 0.84; 'subject:Are': 0.95 |
| 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 :cc:content-type; bh=KXrwK5XJUWAn1RCP//bxEKnmfYG8N36G6lOb5/BqPpc=; b=UuNYvL8YL06M++EzcrlQTnMJc1DhNPSmStGJhIh+vgo2l0I5NxYza1LxYp/RTmf4NB uuNYjVXCjTtkqskDuglWSSHX7Y85r7sh86aWPogZ0IWqUeTInGuBLC5qz41VRt3zBhTP XQcfBVa0Lij2eNtltvaMiHVRdbXlAPDDq/+dzYHBY1QkR2Sk5eXKMIHVfkFR+qMvzwHH ErxMBo4G2ec/lxp4LLkXqffQhC4fTqZUmrsQHTsLRib02V2ZKjGh8Qk/yxDtR4LZtoMH Ag0EYyzTi7cBchEyQv9emEfpUd3nD3ADz/r3iyFaYNL+9pW/JQu2Upr4nLcf3uXKsKqA Ds4g== |
| X-Received | by 10.60.92.199 with SMTP id co7mr8642212oeb.37.1442189613762; Sun, 13 Sep 2015 17:13:33 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <CAP7+vJJqo8OWaEF6KEEKcEfGH9L5Tmnz+qAqa+ukscWn=6xW1w@mail.gmail.com> |
| References | <m2h9mzqyy7.fsf@fastmail.com> <CAExdVNm0rrxhbSONfQdor7e=9t+6Tg3hh6eFq-h0NnfdpteVYg@mail.gmail.com> <1442085362.324875.381920729.5E7A6DCE@webmail.messagingengine.com> <CAExdVNnUwRKN2q=trpnD9=mxnXvuosWKO+s5=PCfjAO45-Yugw@mail.gmail.com> <CAP7h-xYFAggqbJBNCZbYFwUqCPzW7-4Rc0x_SzgAumpFYAr6oA@mail.gmail.com> <CAExdVNmfTsqunRR_b-Q1YqWrTjsV1L5ppAoAnL7SUwgR2PFU0A@mail.gmail.com> <CAP7h-xbqq2Eu+vVO2g4WmbRJ=gmL1r9D2sWhKe=qQ8Ev-n415w@mail.gmail.com> <CAP7+vJ+1Vg21qOWAD+9R2REDnWiW4o6nj=Rh8fx3x3cAZipcdw@mail.gmail.com> <CAP7h-xbA6ZagKj+rQ_cCc8d0oK1F329AAhSjY240iiDyB4756A@mail.gmail.com> <CAExdVNnw6zfJQ_wFOurjj6kcLcbr9RgXA7kvyNPmgraMcHU4vQ@mail.gmail.com> <CAP7h-xYp=MsOcvFXNCHNkXDDGH=jcAwYSSw1WWchy5bwZKjwLA@mail.gmail.com> <201509131224.t8DCOXHO004891@fido.openend.se> <CAP7+vJJqo8OWaEF6KEEKcEfGH9L5Tmnz+qAqa+ukscWn=6xW1w@mail.gmail.com> |
| From | Tim Peters <tim.peters@gmail.com> |
| Date | Sun, 13 Sep 2015 19:13:19 -0500 |
| Subject | Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo? |
| To | Guido van Rossum <guido@python.org> |
| Cc | Laura Creighton <lac@openend.se>, Alexander Belopolsky <alexander.belopolsky@gmail.com>, Python-List <python-list@python.org>, datetime-sig <datetime-sig@python.org> |
| Content-Type | text/plain; charset=UTF-8 |
| X-BeenThere | python-list@python.org |
| X-Mailman-Version | 2.1.20+ |
| 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.507.1442189622.8327.python-list@python.org> (permalink) |
| Lines | 21 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1442189622 news.xs4all.nl 23771 [2001:888:2000:d::a6]:60349 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:96536 |
Show key headers only | View raw
[Guido]
> Wouldn't it be sufficient for people in Creighton to set their timezone to
> US/Central? IIUC the Canadian DST rules are the same as the US ones. Now,
> the question may remain how do people know what to set their timezone to.
> But neither pytz nor datetime can help with that -- it is up to the
> sysadmin.
As Laura's use case evolved, it seems it was more that a train
traveler from Halifax to Creighton wants to tell their Halifax
relatives when they'll arrive in Creighton, but (of course) expressed
in Halifax time. Nobody in this case knows anything about Creighton's
rules, except the traveler may be staring at a train schedule giving
arrival in Creighton time anyway.
While this may be beyond pytz's wizardy, nothing is too hard for datetime ;-)
datetime.timezone.setcontext("datetime-sig messages from mid-Sep 2015")
arrivaltime = datetime.strptime(scraped_arrival_time, "<magic>")
arrivaltime = datetime.replace(arrivaltime,
tzinfo=gettz("Context/Creighton"))
print(arrivaltime.astimezone(gettz("Context/Halifax"))
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
Re: [Datetime-SIG] Are there any "correct" implementations of tzinfo? Tim Peters <tim.peters@gmail.com> - 2015-09-13 19:13 -0500
csiph-web