diff --git a/brewman/brewman/models/tzinfoutc.py b/brewman/brewman/models/tzinfoutc.py index 07b5530a..b9445a67 100644 --- a/brewman/brewman/models/tzinfoutc.py +++ b/brewman/brewman/models/tzinfoutc.py @@ -23,9 +23,11 @@ class UTC(tzinfo): utc = UTC() -def get_age(old_date, now = datetime.utcnow().replace(tzinfo=utc)): +def get_age(old_date, now = None): def isNaive(date): return date.tzinfo is None or date.tzinfo.utcoffset(date) is None + if now is None: + now = datetime.utcnow().replace(tzinfo=utc) if isNaive(old_date) == isNaive(now): pass elif isNaive(old_date):