[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [ooni-probe/master] Convert last runtime into UTC



commit 5d0f080b6d968172171c16cdd9a9ebd8cb887972
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
Date:   Mon Sep 12 17:00:27 2016 +0200

    Convert last runtime into UTC
---
 ooni/agent/scheduler.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/ooni/agent/scheduler.py b/ooni/agent/scheduler.py
index a7713e0..0a6cc0f 100644
--- a/ooni/agent/scheduler.py
+++ b/ooni/agent/scheduler.py
@@ -16,6 +16,8 @@ from ooni.utils.files import human_size_to_bytes, directory_usage
 from ooni.deck.store import input_store, deck_store, DEFAULT_DECKS
 from ooni.settings import config
 from ooni.contrib import croniter
+from ooni.contrib.dateutil.tz import tz
+
 from ooni.geoip import probe_ip
 from ooni.measurements import list_measurements
 
@@ -91,7 +93,8 @@ class ScheduledTask(object):
             return CANARY_DATE
         with self._last_run.open('r') as in_file:
             date_str = in_file.read()
-        return datetime.strptime(date_str, self._time_format)
+        return datetime.strptime(date_str, self._time_format).replace(
+            tzinfo=tz.tzutc())
 
     def _update_last_run(self, last_run_time):
         with self._last_run.open('w') as out_file:



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits