Kaydet (Commit) fce688cc authored tarafından Adrian Holovaty's avatar Adrian Holovaty

Fixed #886 -- timesince utility now supports microseconds. Thanks, Aaron Swartz

git-svn-id: http://code.djangoproject.com/svn/django/trunk@1374 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 87e0c2a7
import datetime, time
import datetime, math, time
from django.utils.tzinfo import LocalTimezone
from django.utils.translation import ngettext
......@@ -30,6 +30,8 @@ def timesince(d, now=None):
count = since / seconds
if count != 0:
break
if count < 0:
return '%d milliseconds' % math.floor(delta.microseconds / 1000)
s = '%d %s' % (count, name(count))
if i + 1 < len(chunks):
# Now get the second item
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment