Lines Matching refs:days
68 * so that two delta days can be added w/o fear of overflowing a signed
116 #define GET_TD_DAYS(o) (((PyDateTime_Delta *)(o))->days)
120 #define SET_TD_DAYS(o, v) ((o)->days = (v))
208 /* For each month ordinal in 1..12, the number of days in that month,
209 * and the number of days before that month in the same year. These
235 /* year, month -> number of days in that month in that year */
247 /* year, month -> number of days in year preceding first day of month */
251 int days;
255 days = _days_before_month[month];
257 ++days;
258 return days;
261 /* year -> number of days before January 1st of year. Remember that we
276 /* Number of days in 4, 100, and 400 year cycles. That these have
279 #define DI4Y 1461 /* days_before_year(5); days in 4 years */
280 #define DI100Y 36524 /* days_before_year(101); days in 100 years */
281 #define DI400Y 146097 /* days_before_year(401); days in 400 years */
317 /* Now n is the (non-negative) offset, in days, from January 1 of
435 /* Check that -MAX_DELTA_DAYS <= days <= MAX_DELTA_DAYS. If so, return 0.
439 check_delta_day_range(int days)
441 if (-MAX_DELTA_DAYS <= days && days <= MAX_DELTA_DAYS)
444 "days=%d; must have magnitude <= %d",
445 days, MAX_DELTA_DAYS);
531 /* Fiddle days (d), seconds (s), and microseconds (us) so that
558 /* Fiddle years (y), months (m), and days (d) so that
567 int dim; /* # of days in month */
582 /* Move day-1 days from the first of the month. First try to
627 /* Fiddle out-of-bounds months and days so that the result makes some kind
1112 * case, raises OverflowError and returns NULL if the normalized days is out
1116 new_delta_ex(int days, int seconds, int microseconds, int normalize,
1122 normalize_d_s_us(&days, &seconds, µseconds);
1126 if (check_delta_day_range(days) < 0)
1132 SET_TD_DAYS(self, days);
1479 /* Offset is normalized, so it is negative if days < 0 */
1841 * (24*3600*self.days + self.seconds)*1000000 + self.microseconds
1857 x2 = PyNumber_Multiply(x1, seconds_per_day); /* days in seconds */
1863 /* x2 has days in seconds */
1867 x3 = PyNumber_Add(x1, x2); /* days and seconds in seconds */
1874 /* x3 has days+seconds in seconds */
1881 /* x1 has days+seconds in us */
1965 num = PyTuple_GET_ITEM(tuple, 0); /* leftover days */
2163 int days = GET_TD_DAYS(left) + GET_TD_DAYS(right);
2167 result = new_delta(days, seconds, microseconds, 1);
2222 int days = GET_TD_DAYS(left) - GET_TD_DAYS(right);
2226 result = new_delta(days, seconds, microseconds, 1);
2528 "days", "seconds", "microseconds", "milliseconds",
2569 y = accum("days", x, day, us_per_day, &leftover_us);
2641 Py_SETREF(args, PyUnicode_FromFormat("days=%d", GET_TD_DAYS(self)));
2685 int days = GET_TD_DAYS(self);
2687 if (days) {
2690 days, (days == 1 || days == -1) ? "" : "s",
2694 days, (days == 1 || days == -1) ? "" : "s",
2744 {"days", T_INT, OFFSET(days), READONLY,
2745 PyDoc_STR("Number of days.")},
2767 "timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, "
3995 /* Offset is normalized, so it is negative if days < 0 */
6018 int days, seconds;
6021 days = ymd_to_ord(GET_YEAR(self),
6027 temp1 = new_delta(days, seconds,