Format datetime string correctly

- Format datetime string in a manner compatible with sqlite (i.e.
  "2016-02-04 12:03" rather than "2016-2-4 12:3")
This commit is contained in:
George Lacey 2016-09-21 17:09:06 +01:00
parent a5e4aa43af
commit 3229d125b3

View File

@ -26,7 +26,7 @@ class LogEntry(object):
def datetime_string(self):
x = self.datetime
return "%s-%s-%s %s:%s:%s" % (x.year, x.month, x.day,
return "%04d-%02d-%02d %02d:%02d:%02d" % (x.year, x.month, x.day,
x.hour, x.minute, x.second)