Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #93359
| X-FeedAbuse | http://nntpfeed.proxad.net/abuse.pl feeded by 78.192.65.63 |
|---|---|
| Path | csiph.com!usenet.pasdenom.info!nntpfeed.proxad.net!news.muarf.org!news.roellig-ltd.de!open-news-network.org!border2.nntp.ams1.giganews.com!border1.nntp.ams1.giganews.com!nntp.giganews.com!newsfeed.xs4all.nl!newsfeed8.news.xs4all.nl!post.news.xs4all.nl!not-for-mail |
| Return-Path | <rosuav@gmail.com> |
| X-Original-To | python-list@python.org |
| Delivered-To | python-list@mail.python.org |
| X-Spam-Status | OK 0.016 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; '16,': 0.03; '21,': 0.07; 'dst': 0.07; 'boundaries.': 0.09; 'cc:addr:python-list': 0.10; 'python': 0.11; 'wed,': 0.15; 'from:addr:rosuav': 0.16; 'from:name:chris angelico': 0.16; 'offsets': 0.16; 'opposite': 0.16; 'utc.': 0.16; 'wrote:': 0.16; 'example.': 0.18; '>>>': 0.20; 'cc:2**0': 0.21; 'cc:addr:python.org': 0.21; '2015': 0.23; 'tried': 0.24; 'import': 0.24; 'header:In-Reply-To:1': 0.24; '14,': 0.27; 'message-id:@mail.gmail.com': 0.28; '13,': 0.29; 'values': 0.30; "we're": 0.30; 'maybe': 0.31; "can't": 0.32; 'skip:d 20': 0.32; 'pacific': 0.33; 'right?': 0.33; 'received:google.com': 0.34; 'but': 0.36; 'subject:: ': 0.37; 'version': 0.38; 'skip:p 20': 0.38; 'pm,': 0.39; 'easily': 0.39; 'subject:-': 0.39; 'yes': 0.60; 'your': 0.60; 'even': 0.61; 'times': 0.61; 'show': 0.62; '30,': 0.63; 'hour': 0.69; 'jul': 0.72; 'saw': 0.76; 'chrisa': 0.84; 'converter,': 0.84; 'to:none': 0.90 |
| DKIM-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:cc :content-type; bh=zgf1Q8+ib1J5amFgJ3XKvCGiwLf+autHZQSpSaAqO54=; b=CuyWRzQYxB+Cn0tTQLd/5eAg+wvLnWCCf6tAxcvDpqLWyMeQDcHqxRpeYnWql11TXH daK8YBH4DaMMVX9UZQBB+jlsYmlUiB0+knOPTjlW5UKd0KUVuaZ95cGV5SRu7+5pCtVv eZgCJIijY+Ct8kA1NcIX5J8ay9Qc/LflpttJW5PvTL4QE1DIT/RK2qWIa4G/5QQN1W5u aRY+3LG2mAcxOj7XLy8W4qW1bwoD6Itbp2KorOjLKkuAfMNYltIckDWBXNf9fXSngCjR G5f51KfhCdIIERiEUHfmTwOCDdH/euj6V/ayOaK5ZbqMHudn3bsvvrnRcceYnjnwM3hC LkUQ== |
| MIME-Version | 1.0 |
| X-Received | by 10.42.43.199 with SMTP id y7mr2294427ice.12.1435734938764; Wed, 01 Jul 2015 00:15:38 -0700 (PDT) |
| In-Reply-To | <cvhdcpFdnliU1@mid.individual.net> |
| References | <cve7ppFk1viU1@mid.individual.net> <cvhdcpFdnliU1@mid.individual.net> |
| Date | Wed, 1 Jul 2015 17:15:38 +1000 |
| Subject | Re: Matplotlib X-axis timezone trouble |
| From | Chris Angelico <rosuav@gmail.com> |
| Cc | "python-list@python.org" <python-list@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.207.1435734941.3674.python-list@python.org> (permalink) |
| Lines | 32 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1435734941 news.xs4all.nl 2939 [2001:888:2000:d::a6]:45598 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:93359 |
Show key headers only | View raw
On Wed, Jul 1, 2015 at 3:50 PM, Peter Pearson <pkpearson@nowhere.invalid> wrote:
> But look:
>
> >>> from datetime import datetime
> >>> import pytz
> >>> pacific = pytz.timezone("US/Pacific")
> >>> dt1 = datetime(2006, 11, 21, 16, 30, tzinfo=pacific) # no DST
> >>> dt2 = datetime(2006, 6, 14, 13, 0, tzinfo=pacific) # yes DST
> >>> dt1.dst()
> datetime.timedelta(0)
> >>> dt2.dst()
> datetime.timedelta(0)
> >>> dt1.utcoffset()
> datetime.timedelta(-1, 57600)
> >>> dt2.utcoffset()
> datetime.timedelta(-1, 57600)
>
> The dst() values are equal, and the utcoffset() values are equal, even
> though one datetime is during DST and the other is not -- exactly the
> opposite of the example.
Just to confirm, they are still showing the times as 16:30 and 13:00, right?
Interestingly, when I tried this (pytz version 2015.4, Python 2.7.9,
Debian Jessie), I saw utcoffset() showing (-1, 58020) for both. That
seems... odd. And I can't fault your dates - those definitely ought to
be easily inside and easily outside the DST boundaries. When I try
those dates in an unrelated time converter, they do show seven- and
eight- hour offsets to UTC. Maybe we're both misunderstanding the
meaning of utcoffset()?
ChrisA
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Matplotlib X-axis timezone trouble Peter Pearson <pkpearson@nowhere.invalid> - 2015-06-30 00:56 +0000
Re: Matplotlib X-axis timezone trouble Laura Creighton <lac@openend.se> - 2015-06-30 04:03 +0200
Re: Matplotlib X-axis timezone trouble Peter Pearson <pkpearson@nowhere.invalid> - 2015-06-30 04:57 +0000
Re: Matplotlib X-axis timezone trouble Chris Angelico <rosuav@gmail.com> - 2015-06-30 12:11 +1000
Re: Matplotlib X-axis timezone trouble Peter Pearson <pkpearson@nowhere.invalid> - 2015-06-30 04:49 +0000
Re: Matplotlib X-axis timezone trouble Chris Angelico <rosuav@gmail.com> - 2015-06-30 17:01 +1000
Re: Matplotlib X-axis timezone trouble Peter Pearson <pkpearson@nowhere.invalid> - 2015-06-30 16:42 +0000
Re: Matplotlib X-axis timezone trouble Chris Angelico <rosuav@gmail.com> - 2015-07-01 02:55 +1000
Re: Matplotlib X-axis timezone trouble Peter Pearson <pkpearson@nowhere.invalid> - 2015-07-01 05:50 +0000
Re: Matplotlib X-axis timezone trouble Chris Angelico <rosuav@gmail.com> - 2015-07-01 17:15 +1000
Datetime timezone trouble (was: Matplotlib X-axis timezone trouble) Peter Pearson <pkpearson@nowhere.invalid> - 2015-07-01 16:36 +0000
Re: Datetime timezone trouble (was: Matplotlib X-axis timezone trouble) Ian Kelly <ian.g.kelly@gmail.com> - 2015-07-01 10:55 -0600
Re: Datetime timezone trouble (was: Matplotlib X-axis timezone trouble) Peter Pearson <pkpearson@nowhere.invalid> - 2015-07-01 19:09 +0000
Re: Datetime timezone trouble (was: Matplotlib X-axis timezone trouble) Chris Angelico <rosuav@gmail.com> - 2015-07-02 03:08 +1000
Re: Matplotlib X-axis timezone trouble Akira Li <4kir4.1i@gmail.com> - 2015-07-04 07:29 +0300
Re: Matplotlib X-axis timezone trouble [SOLVED] Peter Pearson <pkpearson@nowhere.invalid> - 2015-07-04 17:37 +0000
Re: Matplotlib X-axis timezone trouble Tony the Tiger <tony@tiger.invalid> - 2015-07-09 19:50 +0000
Re: Matplotlib X-axis timezone trouble Peter Pearson <pkpearson@nowhere.invalid> - 2015-07-10 16:15 +0000
csiph-web