pytoml icon indicating copy to clipboard operation
pytoml copied to clipboard

Datetimes are not timezone aware

Open davidfischer opened this issue 12 years ago • 2 comments

Since the timezone is specified in the parsed datetime, the datetime should have the timezone (UTC) specified.

davidfischer avatar Feb 27 '13 02:02 davidfischer

Not sure about this, because in the context of TOML, every timestamp value is assured to be Z. So it feels right for the tzinfo of our datetime objects to be singleton, i.e., locked to None.

For some perspective, PyYAML does the same:

>>> import yaml
>>> print yaml.load('- 2001-12-15T02:59:23Z')[0].tzinfo
None

bryant avatar Feb 27 '13 04:02 bryant

I can understand your hesitation. If you read this and you still think that assuming UTC is correct, then feel free to close this. I just try to avoid naive datetimes as much as possible.

davidfischer avatar Feb 27 '13 04:02 davidfischer