Django

Code

Changeset 1374

Show
Ignore:
Timestamp:
11/23/05 15:13:00 (2 years ago)
Author:
adrian
Message:

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

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/trunk/django/utils/timesince.py

    r1359 r1374  
    1 import datetime, time 
     1import datetime, math, time 
    22from django.utils.tzinfo import LocalTimezone 
    33from django.utils.translation import ngettext 
     
    3131        if count != 0: 
    3232            break 
     33    if count < 0: 
     34        return '%d milliseconds' % math.floor(delta.microseconds / 1000) 
    3335    s = '%d %s' % (count, name(count)) 
    3436    if i + 1 < len(chunks):