We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9cd65dc commit f220b67Copy full SHA for f220b67
src/humanize/time.py
@@ -577,12 +577,8 @@ def precisedelta(
577
years, days = _quotient_and_remainder(days, 365, YEARS, min_unit, suppress_set)
578
months, days = _quotient_and_remainder(days, 30.5, MONTHS, min_unit, suppress_set)
579
580
- # If DAYS is not in suppress, we can represent the days but
581
- # if it is a suppressed unit, we need to carry it to a lower unit,
582
- # seconds in this case.
583
- #
584
- # The same applies for secs and usecs below
585
- days, secs = _carry(days, secs, 24 * 3600, DAYS, min_unit, suppress_set)
+ secs = days * 24 * 3600 + secs
+ days, secs = _quotient_and_remainder(secs, 24 * 3600, DAYS, min_unit, suppress_set)
586
587
hours, secs = _quotient_and_remainder(secs, 3600, HOURS, min_unit, suppress_set)
588
minutes, secs = _quotient_and_remainder(secs, 60, MINUTES, min_unit, suppress_set)
0 commit comments