summaryrefslogtreecommitdiff
path: root/timestamp.py
diff options
context:
space:
mode:
Diffstat (limited to 'timestamp.py')
-rw-r--r--timestamp.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/timestamp.py b/timestamp.py
index b0a535c..8b8715d 100644
--- a/timestamp.py
+++ b/timestamp.py
@@ -3,6 +3,7 @@
from __future__ import print_function, absolute_import, division, unicode_literals
import datetime
+import copy
class TimeStamp(datetime.datetime):
@@ -11,3 +12,9 @@ class TimeStamp(datetime.datetime):
def __new__(cls, *args, **kw): # datetime is immutable
return datetime.datetime.__new__(cls, *args, **kw)
+
+ def __deepcopy__(self, memo):
+ ts = TimeStamp(self.year, self.month, self.day,
+ self.hour, self.minute, self.second)
+ ts._yaml = copy.deepcopy(self._yaml)
+ return ts