Lines Matching defs:month
68 #define MAXDAYS 42 /* max slots in a month array */
157 int ambiguity, year, month, date;
222 long month, year;
285 month = 0;
288 month = strtol(*argv++, &eoi, 10);
289 if (month < 1 || month > 12 || *eoi != '\0')
290 errx(1, "illegal month value: use 1-12");
300 month = strtol(eoi + 1, &eoi, 10);
301 if (month < 1 || month > 12 || *eoi != '\0')
302 errx(1, "illegal month value: use 1-12");
314 month = reform->month;
316 month = local_time->tm_mon + 1;
323 if (!month) {
325 month = 1;
331 monthrange(month, year, before, after, yearly);
346 monthrange(int month, int year, int before, int after, int yearly)
372 month--;
374 startyear = year - (before + 12 - 1 - month) / 12;
375 startmonth = 12 - 1 - ((before + 12 - 1 - month) % 12);
376 endyear = year + (month + after) / 12;
377 endmonth = (month + after) % 12;
384 month = startmonth;
387 skip = month % month_per_row;
388 month -= skip;
409 if (year == endyear && month + i > endmonth)
413 day_array(month + i + 1, year, days[i]);
415 center(month_names[month + i], week_len, sep);
419 month_names[month + i], year);
431 if (year == endyear && month + i > endmonth)
458 if (year == endyear && month + i > endmonth)
475 month += month_per_row;
476 if (month >= 12) {
477 month -= 12;
481 } while (year < endyear || (year == endyear && month <= endmonth));
489 * builds that array for any month from Jan. 1 through Dec. 9999.
492 day_array(int month, int year, int *days)
504 for (dm = month + year * 12, dw = 0; dw < 4; dw++) {
513 dm = days_in_month[leap_year(year)][month];
514 dw = day_in_week(1, month, year);
515 day = julian ? day_in_year(1, month, year) : 1;
519 (month == tm->tm_mon && day == tm->tm_mday)))
531 day_in_year(int day, int month, int year)
536 for (i = 1; i < month; i++)
548 day_in_week(int day, int month, int year)
553 + day_in_year(day, month, year);
665 * the form YYYY/MM/DD. The date and month can be omitted if
672 int year, month, date;
676 i = sscanf(p, "%d%*[/,-]%d%*[/,-]%d%c", &year, &month, &date, &c);
689 year = month = date = -1;
692 month = 0;
704 if (i > 1 && (month < 1 || month > 12))
705 errx(1, "%d: illegal month value: use 1-12", month);
707 date > days_in_month[1][month])
720 days_in_month[1][month]);
733 reform->month = month;
756 (month == 0 || month == reform->month) &&
757 (date == 0 || month == reform->date))
775 j_leap_days(reform->year, reform->month, reform->date) -
776 g_leap_days(reform->year, reform->month, reform->date) -
781 day_in_year(reform->date, reform->month, reform->year) +
783 j_leap_days(reform->year, reform->month, reform->date);
787 * skip back to the first of the month's day of the week.
789 diw = day_in_week(reform->date, reform->month, reform->year);
791 diy = day_in_year(1, reform->month, reform->year);
802 reform_day_array(reform->month + i, reform->year,
810 * Pre-calculates the given month's calendar (in both "standard"
815 reform_day_array(int month, int year, int *done, int *date, int *diw, int *diy,
821 * If the reform was in the month of october or later, then
822 * the month number from the caller could "overflow".
824 if (month > 12) {
825 month -= 12;
831 * later to determine if the month to be displayed is here or
835 scal[MAXDAYS] = month + year * 12;
837 jcal[MAXDAYS] = month + year * 12;
840 * It doesn't matter what the actual month is when figuring
844 mdays = days_in_month[g_leap_year(year, 3, 1)][month];
922 "[-R reform-spec]\n [[month] year]\n");