valid = ['2001-10-26T21:32:52', '2001-10-26T21:32:52+02:00',
    '2001-10-26T19:32:52Z', '2001-10-26T19:32:52+00:00',
    '2001-10-26T21:32:52.12679']
for v in valid:
    print() 
print(v)
r = parse_timestamp(v)
assert all(x is not None for x in r), v
tz = ':'.join('%02d' % x for x in divmod(r[1], 60)) if r[1] else 'Z'
if r[1] > 0:
    tz = '+' + tz
r = r[0].isoformat() + tz
print(r)
assert r.startswith(v[:len('CCYY-MM-DDThh:mm:ss')]), v
print('---')
invalid = ['2001-10-26', '2001-10-26T21:32', '2001-10-26T25:32:52+02:00',
    '01-10-26T21:32']
for v in invalid:
    print(v)
r = parse_timestamp(v)
assert all(x is None for x in r), v
Как разобрать формат xsd:dateTime?