summaryrefslogtreecommitdiff
path: root/timestamp.py
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2016-08-20 10:57:19 +0200
committerAnthon van der Neut <anthon@mnt.org>2016-08-20 10:57:19 +0200
commite826a227fac58b8c4fe312f948c42a2d458af9d2 (patch)
tree6d2862247f951882c1c49ad1a8791bd971b5b5b2 /timestamp.py
parent95a952dc87635fd5c72153add15607a80ac5d02d (diff)
downloadruamel.yaml-e826a227fac58b8c4fe312f948c42a2d458af9d2.tar.gz
fix issue 45: preserve datetime 'T' + timezone
Diffstat (limited to 'timestamp.py')
-rw-r--r--timestamp.py13
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)