Ticket #9080: timesince.patch

File timesince.patch, 603 bytes (added by terryh, 16 years ago)
  • django/utils/timesince.py

     
    3434            now = datetime.datetime.now(LocalTimezone(d))
    3535        else:
    3636            now = datetime.datetime.now()
     37    # If now is date type
     38    elif now.__class__ is not datetime.datetime:
     39        now = datetime.datetime(now.year, now.month, now.day)
    3740
    3841    # ignore microsecond part of 'd' since we removed it from 'now'
    3942    delta = now - (d - datetime.timedelta(0, 0, d.microsecond))
Back to Top