}
%token tAGO tDAY tDAYZONE tID tMERIDIAN tMINUTE_UNIT tMONTH tMONTH_UNIT
-%token tSEC_UNIT tSNUMBER tUNUMBER tZONE tDST
+%token tSEC_UNIT tSNUMBER tUNUMBER tZONE tDST tNEVER
%type <Number> tDAY tDAYZONE tMINUTE_UNIT tMONTH tMONTH_UNIT
%type <Number> tSEC_UNIT tSNUMBER tUNUMBER tZONE
spec : /* NULL */
| spec item
+ | tNEVER {
+ yyYear = 1970;
+ yyMonth = 1;
+ yyDay = 1;
+ yyHour = yyMinutes = yySeconds = 0;
+ yyDSTmode = DSToff;
+ yyTimezone = 0; /* gmt */
+ yyHaveDate++;
+ }
;
item : time {
{ "tenth", tUNUMBER, 10 },
{ "eleventh", tUNUMBER, 11 },
{ "twelfth", tUNUMBER, 12 },
- { "ago", tAGO, 1 },
+ { "ago", tAGO, 1 },
+ { "never", tNEVER, 0 },
{ NULL }
};
Year += 1900;
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
? 29 : 28;
- if (Year < EPOCH /* XXX DANGER! || Year > 1999 */
+ if (Year < EPOCH
|| Month < 1 || Month > 12
/* Lint fluff: "conversion from long may lose accuracy" */
|| Day < 1 || Day > DaysInMonth[(int)--Month])
else {
date = get_date(argv[i], NULL);
if (date == (time_t)-1) {
- fprintf(stderr, "Invalid date specification \"%s\".",
+ fprintf(stderr, "Invalid date specification \"%s\".\n",
argv[i]);
return -1;
}
else {
date = get_date(argv[i], NULL);
if (date == (time_t)-1) {
- fprintf(stderr, "Invalid date specification \"%s\".",
+ fprintf(stderr, "Invalid date specification \"%s\".\n",
argv[i]);
return -1;
}
else {
date = get_date(argv[i], NULL);
if (date == (time_t)-1) {
- fprintf(stderr, "Invalid date specification \"%s\".",
+ fprintf(stderr, "Invalid date specification \"%s\".\n",
argv[i]);
return -1;
}
else {
date = get_date(argv[i], NULL);
if (date == (time_t)-1) {
- fprintf(stderr, "Invalid date specification \"%s\".",
+ fprintf(stderr, "Invalid date specification \"%s\".\n",
argv[i]);
return -1;
}
else {
date = get_date(argv[i], NULL);
if (date == (time_t)-1) {
- fprintf(stderr, "Invalid date specification \"%s\".",
+ fprintf(stderr, "Invalid date specification \"%s\".\n",
argv[i]);
return -1;
}
else {
date = get_date(argv[i], NULL);
if (date == (time_t)-1) {
- fprintf(stderr, "Invalid date specification \"%s\".",
+ fprintf(stderr, "Invalid date specification \"%s\".\n",
argv[i]);
return -1;
}