Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #75414

Re: converting ISO8601 date and time string representations to datetime

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 <roy@panix.com>
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 <roy@panix.com>
In-Reply-To <CANc-5UzBKPNQt+Vk3_pzmasqvwUEWALRHOETwz_RLYzrGe1tpw@mail.gmail.com>
Date Thu, 31 Jul 2014 09:13:14 -0400
Content-Transfer-Encoding quoted-printable
References <mailman.12461.1406797909.18130.python-list@python.org> <roy-FFB727.07524431072014@news.panix.com> <CANc-5UzBKPNQt+Vk3_pzmasqvwUEWALRHOETwz_RLYzrGe1tpw@mail.gmail.com>
To Skip Montanaro <skip@pobox.com>
X-Mailer Apple Mail (2.1283)
Cc Python <python-list@python.org>
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.12464.1406812399.18130.python-list@python.org> (permalink)
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

Show key headers only | View raw


On Jul 31, 2014, at 8:59 AM, Skip Montanaro wrote:

> On Thu, Jul 31, 2014 at 6:52 AM, Roy Smith <roy@panix.com> 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.
> 
> 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

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

converting ISO8601 date and time string representations to datetime Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-07-31 11:11 +0200
  Re: converting ISO8601 date and time string representations to datetime Roy Smith <roy@panix.com> - 2014-07-31 07:52 -0400
    Re: converting ISO8601 date and time string representations to datetime Skip Montanaro <skip@pobox.com> - 2014-07-31 07:59 -0500
    Re: converting ISO8601 date and time string representations to datetime Roy Smith <roy@panix.com> - 2014-07-31 09:13 -0400
    Re: converting ISO8601 date and time string representations to datetime Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-07-31 15:29 +0200

csiph-web