Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #76380
| Path | csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!news.mixmin.net!feeds.phibee-telecom.net!newsfeed.xs4all.nl!newsfeed4.news.xs4all.nl!xs4all!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.014 |
| X-Spam-Evidence | '*H*': 0.97; '*S*': 0.00; 'string': 0.09; 'assumed': 0.09; 'release.': 0.09; '2.7': 0.14; '"right"': 0.16; 'ah,': 0.16; 'docs.': 0.16; 'strftime': 0.16; 'all.': 0.16; 'wrote:': 0.18; 'seems': 0.21; '>>>': 0.22; 'select': 0.22; 'aug': 0.22; 'documented': 0.24; 'subject:problem': 0.24; 'earlier': 0.24; '15,': 0.26; 'equivalent': 0.26; 'skip:" 30': 0.26; 'header:In- Reply-To:1': 0.27; 'am,': 0.29; "doesn't": 0.30; 'message- id:@mail.gmail.com': 0.30; "i'm": 0.30; 'says': 0.33; 'url:python': 0.33; 'fri,': 0.33; 'table': 0.34; 'but': 0.35; 'received:google.com': 0.35; 'there': 0.35; 'url:org': 0.36; 'url:library': 0.38; 'handle': 0.38; 'to:addr:python-list': 0.38; 'sure': 0.39; 'to:addr:python.org': 0.39; 'applicable': 0.60; 'ian': 0.60; 'further': 0.61; 'worth': 0.66; 'behavior': 0.77 |
| 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=+MlAZwLgVVXl3lPUEPXz7FQMG75TE0vGmH/GL1HZHJA=; b=dfiiUDZwrlJj3NldnQbEFXRlmioX1VwtvO4yI71DCTxAg+hd/ODcag3HvrZMTGrpna EOECxoiqkoX+o/7W1VXAVppmAvvbGHXiKfiK7TGNomgXKkpOCK6TvEQOijlBnkPgOQsx 8sK5JnOnOjhcIyGpSi+y+/UWrYZxQ654WTJQLGp1bDmfuANaWjAd/jNCDmG9cq5rkdqq 1qcdgaaKvLHQMwnn2Z2CCxaFvdiALCcoyVjkq94MaDmJolZZl8TFSBmhD9os5hbjODoh TL1c4nHj0yinDUFqGu6Q5t6fJ3jWvzaOB1uuPXRBNkmpTfWcgFh9nKw0MlA9NGFgPmsD 0KXQ== |
| X-Received | by 10.70.35.207 with SMTP id k15mr19999755pdj.5.1408125978770; Fri, 15 Aug 2014 11:06:18 -0700 (PDT) |
| MIME-Version | 1.0 |
| In-Reply-To | <lslgrd$5hh$1@dont-email.me> |
| References | <mailman.13018.1408069502.18130.python-list@python.org> <lskdfb$6bg$1@dont-email.me> <mailman.13032.1408116226.18130.python-list@python.org> <lslgrd$5hh$1@dont-email.me> |
| From | Ian Kelly <ian.g.kelly@gmail.com> |
| Date | Fri, 15 Aug 2014 12:05:38 -0600 |
| Subject | Re: timedelta problem |
| 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.13036.1408125988.18130.python-list@python.org> (permalink) |
| Lines | 30 |
| NNTP-Posting-Host | 2001:888:2000:d::a6 |
| X-Trace | 1408125988 news.xs4all.nl 2922 [2001:888:2000:d::a6]:56488 |
| X-Complaints-To | abuse@xs4all.nl |
| Xref | csiph.com comp.lang.python:76380 |
Show key headers only | View raw
On Fri, Aug 15, 2014 at 11:43 AM, Denis McMahon <denismfmcmahon@gmail.com> wrote: > On Fri, 15 Aug 2014 09:23:02 -0600, Ian Kelly wrote: > >> On Fri, Aug 15, 2014 at 1:39 AM, Denis McMahon >> <denismfmcmahon@gmail.com> wrote: >>> On Fri, 15 Aug 2014 10:24:47 +0800, luofeiyu wrote: >>> >>> On further inspection, it seems that strptime() in 2.7 doesn't handle >>> %z at all. In 3.2, it ignores the value it gets, because there's no >>> practical way to select the "right" tz string from the offset. >> >> I'm not sure when %z was added, but it's worth noting that it doesn't >> seem to be documented earlier than 3.3. > > There may be some confusion because %z is in the table of strftime and > strptime format chars on the 2.7.8 docs at > > https://docs.python.org/2/library/datetime.html#strftime-and-strptime- > behavior > > but I suspect it's only applicable to strftime in that release. Ah, interesting. I was looking at the time.strptime docs. I incorrectly assumed that since help(datetime.strptime) defers to help(time.strptime), the docs would also. I note it says that "datetime.strptime(date_string, format) is equivalent to datetime(*(time.strptime(date_string, format)[0:6]))", but clearly that's not the case when the format includes %z.
Back to comp.lang.python | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
timedelta problem luofeiyu <elearn2014@gmail.com> - 2014-08-15 10:24 +0800
Re: timedelta problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 03:51 +0000
Re: timedelta problem Chris Angelico <rosuav@gmail.com> - 2014-08-15 13:59 +1000
Re: timedelta problem Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-14 22:00 -0600
Re: timedelta problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 07:39 +0000
Re: timedelta problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 08:44 +0000
Re: timedelta problem Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-15 09:23 -0600
Re: timedelta problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 17:43 +0000
Re: timedelta problem Ian Kelly <ian.g.kelly@gmail.com> - 2014-08-15 12:05 -0600
Re: timedelta problem Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-15 17:29 +0100
Re: timedelta problem Denis McMahon <denismfmcmahon@gmail.com> - 2014-08-15 09:36 +0000
csiph-web