Lines Matching +full:start +full:- +full:year
10 * For further information, read the top-level Openvision
11 * copyright which is contained in the top-level MIT Kerberos
58 /* The following block of alloca-related preprocessor directives is here
59 solely to allow compilation by non GNU-C compilers of the C parser
197 ** Daylight-savings mode: on, off, or not yet known.
204 ** Meridian: am, pm, or 24-hour style.
300 yyTimezone = - ($4 % 100 + ($4 / 100) * 60);
314 yyTimezone = - ($6 % 100 + ($6 / 100) * 60);
357 /* ISO 8601 format. yyyy-mm-dd. */
359 yyMonth = -$2;
360 yyDay = -$3;
363 /* e.g. 17-JUN-1992. */
366 yyYear = -$3;
389 yyRelSeconds = -yyRelSeconds;
390 yyRelMonth = -yyRelMonth;
465 { gettext("year"), tMONTH_UNIT, 12 },
478 /* Assorted relative-time words. */
481 { gettext("yesterday"), tMINUTE_UNIT, -1 * 24 * 60 },
484 { gettext("last"), tUNUMBER, -1 },
540 { gettext("ahst"), tZONE, HOUR(10) }, /* Alaska-Hawaii Standard */
543 { gettext("cet"), tZONE, -HOUR(1) }, /* Central European */
544 { gettext("met"), tZONE, -HOUR(1) }, /* Middle European */
545 { gettext("mewt"), tZONE, -HOUR(1) }, /* Middle European Winter */
546 { gettext("mest"), tDAYZONE, -HOUR(1) }, /* Middle European Summer */
547 { gettext("swt"), tZONE, -HOUR(1) }, /* Swedish Winter */
548 { gettext("sst"), tDAYZONE, -HOUR(1) }, /* Swedish Summer */
549 { gettext("fwt"), tZONE, -HOUR(1) }, /* French Winter */
550 { gettext("fst"), tDAYZONE, -HOUR(1) }, /* French Summer */
551 { gettext("eet"), tZONE, -HOUR(2) }, /* Eastern Europe, USSR Zone 1 */
552 { gettext("bt"), tZONE, -HOUR(3) }, /* Baghdad, USSR Zone 2 */
554 { gettext("it"), tZONE, -HOUR(3.5) },/* Iran */
556 { gettext("zp4"), tZONE, -HOUR(4) }, /* USSR Zone 3 */
557 { gettext("zp5"), tZONE, -HOUR(5) }, /* USSR Zone 4 */
559 { gettext("ist"), tZONE, -HOUR(5.5) },/* Indian Standard */
561 { gettext("zp6"), tZONE, -HOUR(6) }, /* USSR Zone 5 */
565 { gettext("nst"), tZONE, -HOUR(6.5) },/* North Sumatra */
566 { gettext("sst"), tZONE, -HOUR(7) }, /* South Sumatra, USSR Zone 6 */
568 { gettext("wast"), tZONE, -HOUR(7) }, /* West Australian Standard */
569 { gettext("wadt"), tDAYZONE, -HOUR(7) }, /* West Australian Daylight */
571 { gettext("jt"), tZONE, -HOUR(7.5) },/* Java (3pm in Cronusland!) */
573 { gettext("cct"), tZONE, -HOUR(8) }, /* China Coast, USSR Zone 7 */
574 { gettext("jst"), tZONE, -HOUR(9) }, /* Japan Standard, USSR Zone 8 */
575 { gettext("kst"), tZONE, -HOUR(9) }, /* Korean Standard */
577 { gettext("cast"), tZONE, -HOUR(9.5) },/* Central Australian Standard */
578 { gettext("cadt"), tDAYZONE, -HOUR(9.5) },/* Central Australian Daylight */
580 { gettext("east"), tZONE, -HOUR(10) }, /* Eastern Australian Standard */
581 { gettext("eadt"), tDAYZONE, -HOUR(10) }, /* Eastern Australian Daylight */
582 { gettext("gst"), tZONE, -HOUR(10) }, /* Guam Standard, USSR Zone 9 */
583 { gettext("kdt"), tZONE, -HOUR(10) }, /* Korean Daylight */
584 { gettext("nzt"), tZONE, -HOUR(12) }, /* New Zealand */
585 { gettext("nzst"), tZONE, -HOUR(12) }, /* New Zealand Standard */
586 { gettext("nzdt"), tDAYZONE, -HOUR(12) }, /* New Zealand Daylight */
587 { gettext("idle"), tZONE, -HOUR(12) }, /* International Date Line East */
608 return -1;
612 return -1;
616 return -1;
620 return -1;
633 Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode) in Convert() argument
636 time_t Year;
650 if (Year < 0)
651 Year = -Year;
652 if (Year < 1900)
653 Year += 1900;
654 DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
656 if (Year < EPOCH
657 || Year > EPOCH_END
660 || Day < 1 || Day > DaysInMonth[(int)--Month])
661 return -1;
663 for (Julian = Day - 1, i = 0; i < Month; i++)
665 for (i = EPOCH; i < Year; i++)
666 Julian += 365 + ((i % 4 == 0) && ((Year % 100 != 0) ||
667 (Year % 400 == 0)));
671 return -1;
674 || (DSTmode == DSTmaybe && localtime(&Julian)->tm_isdst))
675 Julian -= 60 * 60;
681 DSTcorrect(Start, Future) in DSTcorrect() argument
682 time_t Start; in DSTcorrect()
688 StartDay = (localtime(&Start)->tm_hour + 1) % 24;
689 FutureDay = (localtime(&Future)->tm_hour + 1) % 24;
690 return (Future - Start) + (StartDay - FutureDay) * 60L * 60L;
695 RelativeDate(Start, DayOrdinal, DayNumber) in RelativeDate() argument
696 time_t Start; in RelativeDate()
703 now = Start;
705 now += SECSPERDAY * ((DayNumber - tm->tm_wday + 7) % 7);
706 now += 7 * SECSPERDAY * (DayOrdinal <= 0 ? DayOrdinal : DayOrdinal - 1);
707 return DSTcorrect(Start, now);
712 RelativeMonth(Start, RelMonth) in RelativeMonth() argument
713 time_t Start; in RelativeMonth()
718 time_t Year; local
723 tm = localtime(&Start);
724 Month = 12 * tm->tm_year + tm->tm_mon + RelMonth;
725 Year = Month / 12;
727 ret = Convert(Month, (time_t)tm->tm_mday, Year,
728 (time_t)tm->tm_hour, (time_t)tm->tm_min, (time_t)tm->tm_sec,
730 if (ret == -1)
732 return DSTcorrect(Start, ret);
771 for (tp = MonthDayTable; tp->name; tp++) {
773 if (strncmp(buff, GETTEXT(tp->name), 3) == 0) {
774 yylval.Number = tp->value;
775 return tp->type;
778 else if (strcmp(buff, GETTEXT(tp->name)) == 0) {
779 yylval.Number = tp->value;
780 return tp->type;
784 for (tp = TimezoneTable; tp->name; tp++)
785 if (strcmp(buff, GETTEXT(tp->name)) == 0) {
786 yylval.Number = tp->value;
787 return tp->type;
793 for (tp = UnitsTable; tp->name; tp++)
794 if (strcmp(buff, GETTEXT(tp->name)) == 0) {
795 yylval.Number = tp->value;
796 return tp->type;
800 i = strlen(buff) - 1;
803 for (tp = UnitsTable; tp->name; tp++)
804 if (strcmp(buff, GETTEXT(tp->name)) == 0) {
805 yylval.Number = tp->value;
806 return tp->type;
811 for (tp = OtherTable; tp->name; tp++)
812 if (strcmp(buff, GETTEXT(tp->name)) == 0) {
813 yylval.Number = tp->value;
814 return tp->type;
825 for (tp = TimezoneTable; tp->name; tp++)
826 if (strcmp(buff, GETTEXT(tp->name)) == 0) {
827 yylval.Number = tp->value;
828 return tp->type;
849 if (isdigit((int) c) || c == '-' || c == '+') { in yylex()
850 if (c == '-' || c == '+') { in yylex()
851 sign = c == '-' ? -1 : 1; in yylex()
853 /* skip the '-' sign */ in yylex()
859 yylval.Number = 10 * yylval.Number + c - '0'; in yylex()
860 yyInput--; in yylex()
862 yylval.Number = -yylval.Number; in yylex()
867 if (p < &buff[sizeof buff - 1]) in yylex()
870 yyInput--; in yylex()
883 Count--; in yylex()
891 /* Yield A - B, measured in seconds. */
896 int ay = a->tm_year + (TM_YEAR_ORIGIN - 1);
897 int by = b->tm_year + (TM_YEAR_ORIGIN - 1);
902 /* difference in day of year */
903 a->tm_yday - b->tm_yday
905 + ((ay >> 2) - (by >> 2))
906 - (ay/100 - by/100)
907 + ((ay/100 >> 2) - (by/100 >> 2))
909 + (time_t)(ay-by) * 365
910 )*24 + (a->tm_hour - b->tm_hour)
911 )*60 + (a->tm_min - b->tm_min)
912 )*60 + (a->tm_sec - b->tm_sec);
926 time_t Start; local
937 return -1;
942 tm = localtime(&now->time);
943 yyYear = tm->tm_year;
944 yyMonth = tm->tm_mon + 1;
945 yyDay = tm->tm_mday;
946 yyTimezone = now->timezone;
978 * yyDSTmode: DSToff if a non-DST zone is specified, otherwise DSTon
982 * yyDayNumber: 0-6 for Sunday-Saturday
994 * year")
1001 return -1;
1004 * If an absolute time specified, set Start to the equivalent Unix
1005 * timestamp. Otherwise, set Start to now, and if we do not have
1006 * a relatime time (ie: only yyHaveZone), decrement Start to the
1015 Start = Convert(yyMonth, yyDay, yyYear, yyHour, yyMinutes, yySeconds,
1017 if (Start < 0)
1018 return -1;
1021 Start = now->time;
1023 Start -= ((tm->tm_hour * 60L + tm->tm_min) * 60L) + tm->tm_sec;
1029 * months" depends on where you start counting.
1039 Start += yyRelSeconds;
1040 delta = RelativeMonth(Start, yyRelMonth);
1041 if (delta == (time_t) -1)
1042 return -1;
1043 Start += delta;
1054 tod = RelativeDate(Start, yyDayOrdinal, yyDayNumber);
1055 Start += tod;
1058 /* Have to do *something* with a legitimate -1 so it's distinguishable
1060 return Start == -1 ? 0 : Start;
1078 if (d == -1)
1080 gettext("Bad format - couldn't convert.\n"));