git://git.onelab.eu
/
plcapi.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
215c2d5
)
Added datetime format
author
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Sun, 10 Mar 2013 03:41:30 +0000
(22:41 -0500)
committer
Tony Mack
<tmack@paris.CS.Princeton.EDU>
Sun, 10 Mar 2013 03:41:30 +0000
(22:41 -0500)
PLC/Timestamp.py
patch
|
blob
|
history
diff --git
a/PLC/Timestamp.py
b/PLC/Timestamp.py
index
2b01a43
..
7087baf
100644
(file)
--- a/
PLC/Timestamp.py
+++ b/
PLC/Timestamp.py
@@
-21,6
+21,7
@@
class Timestamp:
# this is how we expose times to SQL
sql_format = "%Y-%m-%d %H:%M:%S"
sql_format_utc = "%Y-%m-%d %H:%M:%S UTC"
+
# this one (datetime.isoformat) would work too but that's less readable - we support this input though
iso_format = "%Y-%m-%dT%H:%M:%S"
# sometimes it's convenient to understand more formats
@@
-29,6
+30,7
@@
class Timestamp:
iso_format,
"%Y-%m-%d %H:%M",
"%Y-%m-%d %H:%M UTC",
+ "%Y-%m-%d %H:%M:%S.%f"
]
# for timestamps we usually accept either an int, or an ISO string,