Database mod times should be UTC
authorJack Miller <jack@codezen.org>
Sat, 27 Sep 2014 23:44:12 +0000 (18:44 -0500)
committerJack Miller <jack@codezen.org>
Sun, 28 Sep 2014 00:06:29 +0000 (19:06 -0500)
If they're going to be used for comparison (like sync), it should be
consistent regardless of timezone.

canto_next/storage.py

index e24c607..23494ae 100644 (file)
@@ -117,7 +117,7 @@ class CantoShelf():
         if "control" not in self.cache:
             self.cache["control"] = self.shelf['control']
 
-        ts = int(time.time())
+        ts = int(time.mktime(time.gmtime()))
         self.cache["control"]["canto-user-modified"] = ts
         self.cache["control"]["canto-modified"] = ts
 
@@ -125,7 +125,7 @@ class CantoShelf():
         if "control" not in self.cache:
             self.cache["control"] = self.shelf['control']
 
-        ts = int(time.time())
+        ts = int(time.mktime(time.gmtime()))
         self.cache["control"]["canto-modified"] = ts
 
     @wlock_feeds