summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/timesince.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/django/utils/timesince.py b/django/utils/timesince.py
index bc4f969dc4..0b94d89bc6 100644
--- a/django/utils/timesince.py
+++ b/django/utils/timesince.py
@@ -47,10 +47,11 @@ def timesince(d, now=None):
s += ', %d %s' % (count2, name2(count2))
return s
-def timeuntil(d):
+def timeuntil(d, now=None):
"""
Like timesince, but returns a string measuring the time until
the given time.
"""
- now = datetime.datetime.now()
+ if now == None:
+ now = datetime.datetime.now()
return timesince(now, d)