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


Groups > comp.lang.python > #75432 > unrolled thread

Re: converting ISO8601 date and time string representations to datetime

Started byAlbert-Jan Roskam <fomcl@yahoo.com>
First post2014-07-31 11:59 -0700
Last post2014-08-11 23:57 +0100
Articles 7 — 7 participants

Back to article view | Back to comp.lang.python


Contents

  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

#75432 — Re: converting ISO8601 date and time string representations to datetime

FromAlbert-Jan Roskam <fomcl@yahoo.com>
Date2014-07-31 11:59 -0700
SubjectRe: converting ISO8601 date and time string representations to datetime
Message-ID<mailman.12480.1406833307.18130.python-list@python.org>


>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/2bd28b5d6cd2481674a8b0c54a8bba64ab775f81/iso8601/iso8601.py?at=default

[toc] | [next] | [standalone]


#75448

FromRoy Smith <roy@panix.com>
Date2014-07-31 19:30 -0400
Message-ID<roy-7E7423.19300831072014@news.panix.com>
In reply to#75432
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.

[toc] | [prev] | [next] | [standalone]


#75461

FromWolfgang Maier <wolfgang.maier@biologie.uni-freiburg.de>
Date2014-08-01 08:52 +0200
Message-ID<mailman.12506.1406875903.18130.python-list@python.org>
In reply to#75448
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 !

[toc] | [prev] | [next] | [standalone]


#75513

FromAkira Li <4kir4.1i@gmail.com>
Date2014-08-02 06:53 +0400
Message-ID<mailman.12533.1406948035.18130.python-list@python.org>
In reply to#75448
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

[toc] | [prev] | [next] | [standalone]


#75808

FromJoel Goldstick <joel.goldstick@gmail.com>
Date2014-08-06 14:31 -0400
Message-ID<mailman.12706.1407350323.18130.python-list@python.org>
In reply to#75448
On Fri, Aug 1, 2014 at 10:53 PM, Akira Li <4kir4.1i@gmail.com> wrote:
> 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
>
> --
> https://mail.python.org/mailman/listinfo/python-list

I just came across this package: http://crsmithdev.com/arrow/

Among other features it lists this: Gaps in functionality: ISO-8601
parsing, timespans, humanization


-- 
Joel Goldstick
http://joelgoldstick.com

[toc] | [prev] | [next] | [standalone]


#75811

FromSkip Montanaro <skip@pobox.com>
Date2014-08-06 14:05 -0500
Message-ID<mailman.12709.1407351933.18130.python-list@python.org>
In reply to#75448
On Wed, Aug 6, 2014 at 1:31 PM, Joel Goldstick <joel.goldstick@gmail.com> wrote:
> Among other features it lists this: Gaps in functionality: ISO-8601
> parsing, timespans, humanization

What is "humanization"?

Skip

[toc] | [prev] | [next] | [standalone]


#76085

FromMark Lawrence <breamoreboy@yahoo.co.uk>
Date2014-08-11 23:57 +0100
Message-ID<mailman.12870.1407798006.18130.python-list@python.org>
In reply to#75448
On 06/08/2014 20:05, Skip Montanaro wrote:
> On Wed, Aug 6, 2014 at 1:31 PM, Joel Goldstick <joel.goldstick@gmail.com> wrote:
>> Among other features it lists this: Gaps in functionality: ISO-8601
>> parsing, timespans, humanization
>
> What is "humanization"?
>
> Skip
>

Presumably as in https://pypi.python.org/pypi/humanize

The page states "This modest package contains various common 
humanization utilities, like turning a number into a fuzzy human 
readable duration ('3 minutes ago') or into a human readable size or 
throughput.  It works with python 2.7 and 3.3 and is localized
to Russian, French, and Korean."

-- 
My fellow Pythonistas, ask not what our language can do for you, ask
what you can do for our language.

Mark Lawrence

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web