From: Tony Mack Date: Sun, 10 Mar 2013 03:41:30 +0000 (-0500) Subject: Added datetime format X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;h=55bc059161e5f48e2ad916ff9f1d300a72ccaf65;p=plcapi.git Added datetime format --- diff --git a/PLC/Timestamp.py b/PLC/Timestamp.py index 2b01a438..7087baf5 100644 --- 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,