[New-bugs-announce] [issue23468] ISO 8601 datetime process

Stoneagee report at bugs.python.org
Sun Feb 15 19:46:48 CET 2015


New submission from Stoneagee:

Code:
import dateutil.parser
from datetime import datetime

a='0001-01-01T00:00:00+02:00'
b='1964-01-01T00:00:00+02:00'
ia=dateutil.parser.parse(a)
ib=dateutil.parser.parse(b)
print a
print ia
print b
print ib

output:
0001-01-01T00:00:00+02:00
2001-01-01 00:00:00+02:00
1964-01-01T00:00:00+02:00
1964-01-01 00:00:00+02:00

On wiki ISO 8601, under Combined date and time representations:
If a time zone designator is required, it follows the combined date and time. For example "2007-04-05T14:30Z" or "2007-04-05T12:30-02:00"

I know you may have to fall back template on date such as 1/1/1, but this is ISO and according to my reading, it does not require one.

BTW, my input comes from public posted information.

Thanks,

----------
messages: 236059
nosy: Stoneagee
priority: normal
severity: normal
status: open
title: ISO 8601 datetime process
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue23468>
_______________________________________


More information about the New-bugs-announce mailing list