IIRC, arrow usually calls dateutil to parse dates anyway, and there are many 
other, lighter dependencies that will parse an ISO 8601 date quickly into a 
datetime.datetime object. 

I still think it's reasonable for the .isoformat() operation to have an inverse 
operation in the standard library.

On November 28, 2017 3:45:41 PM EST, Skip Montanaro <skip.montan...@gmail.com> 
wrote:
>> I think the latest version can now strptime offsets of the form
>±HH:MM with
>> %z, so there's no longer anything blocking you from parsing from all
>> isoformat() outputs with strptime, provided you know which one you
>need.
>
>Or just punt and install arrow:
>
>>>> import arrow
>>>> arrow.get('2017-10-20T08:20:08.986166+00:00')
><Arrow [2017-10-20T08:20:08.986166+00:00]>
>>>> arrow.get('2017-10-20T08:20:08.986166+00:00').datetime
>datetime.datetime(2017, 10, 20, 8, 20, 8, 986166, tzinfo=tzoffset(None,
>0))
>
>Skip
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to