From 73650fc12ccb8b30c8bb562283222798d8e2d3aa Mon Sep 17 00:00:00 2001 From: Colin Watson Date: Wed, 25 Sep 2013 14:09:34 +0100 Subject: [PATCH] Change date format to seconds-since-epoch --- policies/policy.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/policies/policy.py b/policies/policy.py index 2e1798a..09c10ee 100644 --- a/policies/policy.py +++ b/policies/policy.py @@ -210,8 +210,7 @@ class AgePolicy(BasePolicy): if options.default_urgency not in mindays: raise ValueError("Missing age-requirement for default urgency (MINDAYS_%s)" % options.default_urgency) self._min_days_default = mindays[options.default_urgency] - # britney's "day" begins at 3pm - self._date_now = int(((time.time() / (60*60)) - 15) / 24) + self._date_now = int(time.time()) self._dates = {} self._urgencies = {} @@ -249,7 +248,7 @@ class AgePolicy(BasePolicy): elif self._dates[source_name][0] != source_data_srcdist.version: self._dates[source_name] = (source_data_srcdist.version, self._date_now) - days_old = self._date_now - self._dates[source_name][1] + days_old = (self._date_now - self._dates[source_name][1]) / 60 / 60 / 24 min_days = self._min_days[urgency] age_info['age-requirement'] = min_days age_info['current-age'] = days_old