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


Groups > comp.lang.python > #75513

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!xlned.com!feeder5.xlned.com!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <python-python-list@m.gmane.org>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.001
X-Spam-Evidence '*H*': 1.00; '*S*': 0.00; 'url:pypi': 0.03; 'url:bitbucket': 0.05; 'combines': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'rfc': 0.09; 'seemed': 0.09; 'subject:string': 0.09; 'subset': 0.09; 'objects.': 0.16; 'readability': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'roy': 0.16; 'wrote:': 0.18; 'trying': 0.19; 'seems': 0.21; 'machine': 0.22; '>>>': 0.22; 'header:User-Agent:1': 0.23; 'right.': 0.26; 'header:X-Complaints- To:1': 0.27; '[1]': 0.29; 'am,': 0.29; 'wonder': 0.29; "i'm": 0.30; '>>>>': 0.31; 'writes:': 0.31; 'url:python': 0.33; 'subject:time': 0.33; 'something': 0.35; 'convert': 0.35; 'there': 0.35; 'dates': 0.36; 'representing': 0.36; 'hi,': 0.36; 'url:org': 0.36; 'message-id:@gmail.com': 0.38; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'profile': 0.61; 'times': 0.62; 'smith': 0.68; 'article': 0.77; 'describes': 0.84; 'received:89': 0.85
X-Injected-Via-Gmane http://gmane.org/
To python-list@python.org
From Akira Li <4kir4.1i@gmail.com>
Subject Re: converting ISO8601 date and time string representations to datetime
Date Sat, 02 Aug 2014 06:53:44 +0400
References <mailman.12480.1406833307.18130.python-list@python.org> <roy-7E7423.19300831072014@news.panix.com> <53DB3931.8070406@biologie.uni-freiburg.de>
Mime-Version 1.0
Content-Type text/plain
X-Gmane-NNTP-Posting-Host 89.169.229.68
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)
Cancel-Lock sha1:zkzNMwroDFhJ6qLflLRoG+1ksho=
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.12533.1406948035.18130.python-list@python.org> (permalink)
Lines 35
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1406948035 news.xs4all.nl 2861 [2001:888:2000:d::a6]:48765
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:75513

Show key headers only | View raw


Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> writes:

> On 08/01/2014 01:30 AM, Roy Smith wrote:
>> In article <mailman.12480.1406833307.18130.python-list@python.org>,
>>   Albert-Jan Roskam <fomcl@yahoo.com> wrote:
>>
>>>> In article <mailman.12461.1406797909.18130.python-list@python.org>,
>>>> Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> wrote:
>>>>
>>>>> Hi,
>>>>> I'm trying to convert ISO8601-compliant strings representing dates or
>>>>> dates and times into datetime.datetime objects.
>>>>
>>>> https://pypi.python.org/pypi/iso8601
>>>
>>> Yikes, what a regex. It must have been painstaking to get that right.
>>> https://bitbucket.org/micktwomey/pyiso8601/src/2bd28b5d6cd2481674a8b0c54a8bba6
>>> 4ab775f81/iso8601/iso8601.py?at=default
>>
>> It is a thing of beauty.
>>
>
> No wonder I found it hard to write something that seemed bulletproof !

It seems it supports only some custom subset of ISO 8601. There is rfc
3339 [1] that describes a profile of the ISO 8601 standard.

rfc 3339 combines human readability with the simplicity of machine parsing.

[1] http://tools.ietf.org/html/rfc3339


--
Akira

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


Thread

Re: converting ISO8601 date and time string representations to datetime Albert-Jan Roskam <fomcl@yahoo.com> - 2014-07-31 11:59 -0700
  Re: converting ISO8601 date and time string representations to datetime Roy Smith <roy@panix.com> - 2014-07-31 19:30 -0400
    Re: converting ISO8601 date and time string representations to datetime Wolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de> - 2014-08-01 08:52 +0200
    Re: converting ISO8601 date and time string representations to datetime Akira Li <4kir4.1i@gmail.com> - 2014-08-02 06:53 +0400
    Re: converting ISO8601 date and time string representations to datetime Joel Goldstick <joel.goldstick@gmail.com> - 2014-08-06 14:31 -0400
    Re: converting ISO8601 date and time string representations to datetime Skip Montanaro <skip@pobox.com> - 2014-08-06 14:05 -0500
    Re: converting ISO8601 date and time string representations to datetime Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-08-11 23:57 +0100

csiph-web