path: root/releng
diff options
authorDan McGee <>2012-03-23 19:29:40 -0500
committerDan McGee <>2012-03-23 19:54:40 -0500
commit90e08b4863dfaecafee5b151478bda4513b12e85 (patch)
treed25065edd39e1357ea0fd8b24ea86ce5630a8fb6 /releng
parentbc1ba4e95a3e572779eb8ba8a947e8d3ce165845 (diff)
Make all datetime objects fully timezone aware
This is most of the transition to Django 1.4 `USE_TZ = True`. We need to ensure we don't mix aware and non-aware datetime objects when dealing with datetimes in the code. Add a utc_now() helper method that we can use most places, and ensure there is always a timezone attached when necessary. Signed-off-by: Dan McGee <>
Diffstat (limited to 'releng')
1 files changed, 3 insertions, 2 deletions
diff --git a/releng/management/commands/ b/releng/management/commands/
index 270c6c34..62f005ff 100644
--- a/releng/management/commands/
+++ b/releng/management/commands/
@@ -1,4 +1,3 @@
-from datetime import datetime
import re
import urllib
from HTMLParser import HTMLParser, HTMLParseError
@@ -6,8 +5,10 @@ from HTMLParser import HTMLParser, HTMLParseError
from django.conf import settings
from import BaseCommand, CommandError
+from main.utils import utc_now
from releng.models import Iso
class IsoListParser(HTMLParser):
def __init__(self):
@@ -53,7 +54,7 @@ class Command(BaseCommand): = True
existing.removed = None
- now = datetime.utcnow()
+ now = utc_now()
# and then mark all other names as no longer active
active=False, removed=now)