Created
August 25, 2017 08:32
-
-
Save akscram/1c0256ccb2b9d19b32b1c4b1391aaf96 to your computer and use it in GitHub Desktop.
pypi/iso8601
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> import iso8601 | |
>>> d = iso8601.parse_date("2007-01-25T12:00:00Z") | |
>>> d | |
datetime.datetime(2007, 1, 25, 12, 0, tzinfo=<iso8601.Utc>) | |
>>> df = d.strftime('%Y-%m-%dT%H:%M:%S%Z') | |
>>> df | |
'2007-01-25T12:00:00UTC' | |
>>> d2 = iso8601.parse_date(df) | |
Traceback (most recent call last): | |
File "<stdin>", line 1, in <module> | |
File "/Users/ash/.iso8601/lib/python2.7/site-packages/iso8601/iso8601.py", line 195, in parse_date | |
raise ParseError("Unable to parse date string %r" % datestring) | |
iso8601.iso8601.ParseError: Unable to parse date string '2007-01-25T12:00:00UTC' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment