diff options
author | Anthon van der Neut <anthon@mnt.org> | 2016-08-20 10:57:19 +0200 |
---|---|---|
committer | Anthon van der Neut <anthon@mnt.org> | 2016-08-20 10:57:19 +0200 |
commit | e826a227fac58b8c4fe312f948c42a2d458af9d2 (patch) | |
tree | 6d2862247f951882c1c49ad1a8791bd971b5b5b2 /timestamp.py | |
parent | 95a952dc87635fd5c72153add15607a80ac5d02d (diff) | |
download | ruamel.yaml-e826a227fac58b8c4fe312f948c42a2d458af9d2.tar.gz |
fix issue 45: preserve datetime 'T' + timezone
Diffstat (limited to 'timestamp.py')
-rw-r--r-- | timestamp.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/timestamp.py b/timestamp.py new file mode 100644 index 0000000..b0a535c --- /dev/null +++ b/timestamp.py @@ -0,0 +1,13 @@ +# coding: utf-8 + +from __future__ import print_function, absolute_import, division, unicode_literals + +import datetime + + +class TimeStamp(datetime.datetime): + def __init__(self, *args, **kw): + self._yaml = dict(t=False, tz=None, delta=0) + + def __new__(cls, *args, **kw): # datetime is immutable + return datetime.datetime.__new__(cls, *args, **kw) |