Lines Matching refs:timedelta
185 hh, mm = divmod(off, timedelta(hours=1))
186 mm, ss = divmod(mm, timedelta(minutes=1))
228 h, rest = divmod(offset, timedelta(hours=1))
229 m, rest = divmod(rest, timedelta(minutes=1))
345 td = timedelta(hours=tz_comps[0], minutes=tz_comps[1],
371 if not isinstance(offset, timedelta):
374 if not -timedelta(1) < offset < timedelta(1):
454 class timedelta: class
622 if isinstance(other, timedelta):
625 return timedelta(self._days + other._days,
633 if isinstance(other, timedelta):
636 return timedelta(self._days - other._days,
642 if isinstance(other, timedelta):
649 return timedelta(-self._days,
666 return timedelta(self._days * other,
672 return timedelta(0, 0, _divide_and_round(usec * a, b))
682 if not isinstance(other, (int, timedelta)):
685 if isinstance(other, timedelta):
688 return timedelta(0, 0, usec // other)
691 if not isinstance(other, (int, float, timedelta)):
694 if isinstance(other, timedelta):
697 return timedelta(0, 0, _divide_and_round(usec, other))
700 return timedelta(0, 0, _divide_and_round(b * usec, a))
703 if isinstance(other, timedelta):
705 return timedelta(0, 0, r)
709 if isinstance(other, timedelta):
712 return q, timedelta(0, 0, r)
718 if isinstance(other, timedelta):
724 if isinstance(other, timedelta):
730 if isinstance(other, timedelta):
736 if isinstance(other, timedelta):
742 if isinstance(other, timedelta):
748 assert isinstance(other, timedelta)
769 timedelta.min = timedelta(-999999999)
770 timedelta.max = timedelta(days=999999999, hours=23, minutes=59, seconds=59,
772 timedelta.resolution = timedelta(microseconds=1)
1014 if isinstance(other, timedelta):
1025 if isinstance(other, timedelta):
1026 return self + timedelta(-other.days)
1030 return timedelta(days1 - days2)
1089 date.resolution = timedelta(days=1)
1313 myhhmm = self._hour * 60 + self._minute - myoff//timedelta(minutes=1)
1314 othhmm = other._hour * 60 + other._minute - otoff//timedelta(minutes=1)
1329 h, m = divmod(timedelta(hours=self.hour, minutes=self.minute) - tzoff,
1330 timedelta(hours=1))
1331 assert not m % timedelta(minutes=1), "whole minute"
1332 m //= timedelta(minutes=1)
1507 time.resolution = timedelta(microseconds=1)
1616 trans = result - probe1 - timedelta(0, max_fold_seconds)
1618 y, m, d, hh, mm, ss = converter(t + trans // timedelta(0, 1))[:6]
1708 t = (self - epoch) // timedelta(0, 1)
1711 return (datetime(y, m, d, hh, mm, ss) - epoch) // timedelta(0, 1)
1798 ts = (self - _EPOCH) // timedelta(seconds=1)
1810 tz = timezone(timedelta(seconds=gmtoff), zone)
2023 if not isinstance(other, timedelta):
2025 delta = timedelta(self.toordinal(),
2045 if isinstance(other, timedelta):
2053 base = timedelta(days1 - days2,
2078 self._hashcode = hash(timedelta(days, seconds, self.microsecond) - tzoff)
2122 datetime.resolution = timedelta(microseconds=1)
2142 if not isinstance(offset, timedelta):
2229 _maxoffset = timedelta(hours=23, minutes=59)
2236 if delta < timedelta(0):
2241 hours, rest = divmod(delta, timedelta(hours=1))
2242 minutes, rest = divmod(rest, timedelta(minutes=1))
2252 timezone.utc = timezone._create(timedelta(0))