Lines Matching defs:ordinal
208 /* For each month ordinal in 1..12, the number of days in that month,
283 /* ordinal -> year, month, day, considering 01-Jan-0001 as day 1. */
285 ord_to_ymd(int ordinal, int *year, int *month, int *day)
289 /* ordinal is a 1-based index, starting at 1-Jan-1. The pattern of
291 * to find the closest 400-year boundary at or before ordinal, then
292 * work with the offset from that boundary to ordinal. Life is much
293 * clearer if we subtract 1 from ordinal first -- then the values
294 * of ordinal at 400-year boundaries are exactly those divisible
311 assert(ordinal >= 1);
312 --ordinal;
313 n400 = ordinal / DI400Y;
314 n = ordinal % DI400Y;
367 /* year, month, day -> ordinal, considering 01-Jan-0001 as day 1. */
390 /* ordinal of closest Monday at or before 1/1 */
606 int ordinal = ymd_to_ord(*y, *m, 1) +
608 if (ordinal < 1 || ordinal > MAXORDINAL) {
611 ord_to_ymd(ordinal, y, m, d);
3031 /* Return new date from proleptic Gregorian ordinal. Raises ValueError if
3032 * the ordinal is out of range.
3038 int ordinal;
3040 if (PyArg_ParseTuple(args, "i:fromordinal", &ordinal)) {
3045 if (ordinal < 1)
3046 PyErr_SetString(PyExc_ValueError, "ordinal must be "
3049 ord_to_ymd(ordinal, &year, &month, &day);
3564 "ordinal.")},
3606 PyDoc_STR("Return proleptic Gregorian ordinal. January 1 of year "
4992 long long ordinal;
5000 ordinal = ymd_to_ord(year, month, day);
5001 return ((ordinal * 24 + hour) * 60 + minute) * 60 + second;