#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 אורי):
You can calculate something like this:
{{{
diff = relativedelta(date2, date1)
years = diff.years
months = diff.months
weeks = diff.days // 7
days = diff.days - weeks * 7
}}}
And then calculate the minutes and seconds from `delta.seconds` in the
original function.
--
Ticket URL: <https://code.djangoproject.com/ticket/33879#comment:6>
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/010701825566bb38-e88bf645-dc8c-4c1f-a946-0f07e312d629-000000%40eu-central-1.amazonses.com.