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: 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: References: Date: Wed, 1 Jul 2015 17:15:38 +1000 Subject: Re: Matplotlib X-axis timezone trouble From: Chris Angelico Cc: "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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: 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 On Wed, Jul 1, 2015 at 3:50 PM, Peter Pearson 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