#33879: timesince - wrong results for 11 months + several weeks
--------------------------------------+------------------------------------
     Reporter:  אורי                  |                    Owner:  nobody
         Type:  Cleanup/optimization  |                   Status:  new
    Component:  Utilities             |                  Version:  dev
     Severity:  Normal                |               Resolution:
     Keywords:                        |             Triage Stage:  Accepted
    Has patch:  0                     |      Needs documentation:  0
  Needs tests:  0                     |  Patch needs improvement:  0
Easy pickings:  0                     |                    UI/UX:  0
--------------------------------------+------------------------------------

Comment (by Mariusz Felisiak):

 Replying to [comment:6 אורי]:
 > You can calculate something like this:
 >
 > {{{
 > from dateutil.relativedelta import relativedelta
 >
 > diff = relativedelta(date2, date1)
 >
 > years = diff.years
 > months = diff.months
 > weeks = diff.days // 7
 > days = diff.days - weeks * 7
 > }}}
 >
 > And then calculate the hours and minutes from `delta.seconds` in the
 original function.

 Adding a new dependency is not an option, IMO. However you can always
 start a discussion on the DevelopersMailingList (see
 [https://code.djangoproject.com/ticket/32727#comment:11 comment]).

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33879#comment:7>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701825827ae4a-866773a7-c5ee-4133-ab38-a4b0c889545b-000000%40eu-central-1.amazonses.com.

Reply via email to