Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.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.006 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'string': 0.09; 'slow.': 0.09; 'subject:string': 0.09; 'to:addr:pobox.com': 0.09; 'to:addr:skip': 0.09; 'cc:addr:python-list': 0.11; '6:52': 0.16; 'received:166.84': 0.16; 'received:166.84.1': 0.16; 'received:166.84.1.89': 0.16; 'received:mailbackend.panix.com': 0.16; 'received:panix.com': 0.16; 'roy': 0.16; 'which,': 0.16; 'wrote:': 0.18; 'library': 0.18; 'all,': 0.19; 'received:10.0.1': 0.19; 'received:166': 0.19; 'thu,': 0.19; 'cc:addr:python.org': 0.22; '31,': 0.24; 'parse': 0.24; 'skip': 0.24; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'function': 0.29; 'feature': 0.29; 'am,': 0.29; "doesn't": 0.30; 'subject:time': 0.33; 'skip:d 20': 0.34; 'common': 0.35; 'but': 0.35; 'really': 0.36; 'useful': 0.36; 'charset:us-ascii': 0.36; 'received:10.0': 0.36; 'should': 0.36; 'received:10': 0.37; 'that,': 0.38; 'even': 0.60; 'easy': 0.60; 'header:Message-Id:1': 0.63; 'more': 0.64; 'life': 0.66; 'smith': 0.68; 'jul': 0.74; '2014,': 0.84; 'email addr:panix.com': 0.84 Subject: Re: converting ISO8601 date and time string representations to datetime Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Roy Smith In-Reply-To: Date: Thu, 31 Jul 2014 09:13:14 -0400 Content-Transfer-Encoding: quoted-printable References: To: Skip Montanaro X-Mailer: Apple Mail (2.1283) Cc: Python X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 19 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1406812399 news.xs4all.nl 2897 [2001:888:2000:d::a6]:44783 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:75414 On Jul 31, 2014, at 8:59 AM, Skip Montanaro wrote: > On Thu, Jul 31, 2014 at 6:52 AM, Roy Smith wrote: >> Sadly, the stdlib datetime really doesn't make life easy for dealing >> with ISO-8601. Dateutil is the classic answer, but it's slow. >=20 > A useful feature for dateutil would be a "sniff" function which, given > a date string that dateutil.parser.parse can handle, instead returns a > format string suitable for use with time.strptime. +0.8. But, even more than that, dateutil should come with a library of = strings for common formats, and a built-in function to parse 8601. It = is, after all, the international standard. -- Roy Smith roy@panix.com