summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-11-03 15:50:06 -0500
committerDan McGee <dan@archlinux.org>2011-11-03 17:19:22 -0500
commitd8e34919811728149a12e30d438318a3c1036a83 (patch)
treef511d59de352114b664cbed62239bdeb65416eb4
parentf26dcbf7285c62f0baa1c64ee813ad0ceff5c288 (diff)
Use UTC now everywhere
Signed-off-by: Dan McGee <dan@archlinux.org>
-rw-r--r--devel/views.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/devel/views.py b/devel/views.py
index ebae3b32..694ed6dc 100644
--- a/devel/views.py
+++ b/devel/views.py
@@ -80,9 +80,9 @@ def clock(request):
devs = User.objects.filter(is_active=True).order_by(
'username').select_related('userprofile')
- # now annotate each dev object with their current time
now = datetime.now()
utc_now = datetime.utcnow().replace(tzinfo=pytz.utc)
+ # now annotate each dev object with their current time
for dev in devs:
tz = pytz.timezone(dev.userprofile.time_zone)
dev.current_time = utc_now.astimezone(tz)
@@ -147,12 +147,12 @@ def report(request, report, username=None):
if report == 'old':
title = 'Packages last built more than two years ago'
- cutoff = datetime.now() - timedelta(days=365 * 2)
+ cutoff = datetime.utcnow() - timedelta(days=365 * 2)
packages = packages.filter(
build_date__lt=cutoff).order_by('build_date')
elif report == 'long-out-of-date':
title = 'Packages marked out-of-date more than 90 days ago'
- cutoff = datetime.now() - timedelta(days=90)
+ cutoff = datetime.utcnow() - timedelta(days=90)
packages = packages.filter(
flag_date__lt=cutoff).order_by('flag_date')
elif report == 'big':