Home | History | Annotate | Download | only in Modules

Lines Matching refs:day

200 /* year, month -> number of days in year preceding first day of month */
242 /* ordinal -> year, month, day, considering 01-Jan-0001 as day 1. */
244 ord_to_ymd(int ordinal, int *year, int *month, int *day)
280 * 100-year cycles precede the desired day, which implies the
281 * desired day is December 31 at the end of a 400-year cycle.
291 * meaning that the desired day is December 31 at the end of the
302 *day = 31;
323 *day = n + 1;
326 /* year, month, day -> ordinal, considering 01-Jan-0001 as day 1. */
328 ymd_to_ord(int year, int month, int day)
330 return days_before_year(year) + days_before_month(year, month) + day;
333 /* Day of week, where Monday==0, ..., Sunday==6. 1/1/1 was a Monday. */
335 weekday(int year, int month, int day)
337 return (ymd_to_ord(year, month, day) + 6) % 7;
379 check_date_args(int year, int month, int day)
392 if (day < 1 || day > days_in_month(year, month)) {
394 "day is out of range for month");
491 /* This gets muddy: the proper range for day can't be determined
492 * without knowing the correct month and year, but if day is, e.g.,
507 /* Now only day can be out of bounds (year may also be out of bounds
509 * If day is out of bounds, what to do is arguable, but at least the
514 /* Move day-1 days from the first of the month. First try to
515 * get off cheap if we're only one day out of range
529 /* move forward a day */
564 normalize_date(int *year, int *month, int *day)
566 return normalize_y_m_d(year, month, day);
573 normalize_datetime(int *year, int *month, int *day,
580 normalize_pair(day, hour, 24);
581 return normalize_date(year, month, day);
656 new_date_ex(int year, int month, int day, PyTypeObject *type)
662 set_date_fields(self, year, month, day);
666 #define new_date(year, month, day) \
667 new_date_ex(year, month, day, &PyDateTime_DateType)
671 new_datetime_ex(int year, int month, int day, int hour, int minute,
680 set_date_fields((PyDateTime_Date *)self, year, month, day);
1409 /* Build a time.struct_time. The weekday and day number are automatically
1934 PyObject *day = NULL;
1953 &day, &second, &us,
1987 if (day) {
1988 y = accum("days", x, day, us_per_day, &leftover_us);
2060 n = PyOS_snprintf(pbuf, buflen, "%d day%s, ", days,
2138 PyDoc_STR("Number of seconds (>= 0 and less than 1 day).")},
2269 {"day", (getter)date_day},
2275 static char *date_kws[] = {"year", "month", "day", NULL};
2284 int day;
2304 &year, &month, &day)) {
2305 if (check_date_args(year, month, day) < 0)
2307 self = new_date_ex(year, month, day, type);
2386 int day;
2392 ord_to_ymd(ordinal, &year, &month, &day);
2394 year, month, day);
2415 int day = GET_DAY(date) + (negate ? -deltadays : deltadays);
2417 if (normalize_date(&year, &month, &day) >= 0)
2418 result = new_date(year, month, day);
2588 int day;
2590 week = divmod(today - week1_monday, 7, &day);
2594 week = divmod(today - week1_monday, 7, &day);
2600 return Py_BuildValue("iii", year, week + 1, day + 1);
2648 int day = GET_DAY(self);
2651 &year, &month, &day))
2653 tuple = Py_BuildValue("iii", year, month, day);
2749 PyDoc_STR("Return the day of the week represented by the date.\n"
2754 "1 is day 1.")},
2757 PyDoc_STR("Return the day of the week represented by the date.\n"
2770 PyDoc_STR("date(year, month, day) --> date object");
3318 1900, 1, 1, /* year, month, day */
3614 /* Accessor properties. Properties for day, month, and year are inherited
3664 "year", "month", "day", "hour", "minute", "second",
3675 int day;
3717 &year, &month, &day, &hour, &minute,
3719 if (check_date_args(year, month, day) < 0)
3725 self = new_datetime_ex(year, month, day,
4078 int day = GET_DAY(date) + GET_TD_DAYS(delta) * factor;
4086 if (normalize_datetime(&year, &month, &day,
4090 return new_datetime(year, month, day,
4149 * seconds in one day.
4603 PyDoc_STR("[tz] -> new datetime with tz's local day and time.")},
4607 PyDoc_STR("Return a new datetime representing UTC day and time.")},
4630 PyDoc_STR("Return date object with same year, month and day.")},
4675 PyDoc_STR("datetime(year, month, day[, hour[, minute[, second[, microsecond[,tzinfo]]]]])\n\
4677 The year, month and day arguments are required. tzinfo may be None, or an\n\
4884 /* A 4-year cycle has an extra leap day over what we'd get from
4890 /* Similarly, a 400-year cycle has an extra leap day over what we'd
4896 /* OTOH, a 100-year cycle has one fewer leap day than we'd get from
4999 on the day DST starts. We want to return the 1:MM EST spelling because that's