summaryrefslogtreecommitdiffstats
path: root/contrib/cvs/lib/getdate.y
diff options
context:
space:
mode:
authorpeter <peter@FreeBSD.org>2000-10-02 06:33:59 +0000
committerpeter <peter@FreeBSD.org>2000-10-02 06:33:59 +0000
commit590c411955d6975551ffeaf41d7faf4b26f836d1 (patch)
treec2ec0b150478a3cab9fb18e60d02dedbdc1cfd15 /contrib/cvs/lib/getdate.y
parent784ea5066cbea73d04e8ce5783dd0eb842e3ac1f (diff)
downloadFreeBSD-src-590c411955d6975551ffeaf41d7faf4b26f836d1.zip
FreeBSD-src-590c411955d6975551ffeaf41d7faf4b26f836d1.tar.gz
Import cvs-1.11 onto vendor branch.
Diffstat (limited to 'contrib/cvs/lib/getdate.y')
-rw-r--r--contrib/cvs/lib/getdate.y18
1 files changed, 13 insertions, 5 deletions
diff --git a/contrib/cvs/lib/getdate.y b/contrib/cvs/lib/getdate.y
index 9a4a8fa..c3f18c6 100644
--- a/contrib/cvs/lib/getdate.y
+++ b/contrib/cvs/lib/getdate.y
@@ -281,9 +281,15 @@ date : tUNUMBER '/' tUNUMBER {
yyDay = $3;
}
| tUNUMBER '/' tUNUMBER '/' tUNUMBER {
- yyMonth = $1;
- yyDay = $3;
- yyYear = $5;
+ if ($1 >= 100) {
+ yyYear = $1;
+ yyMonth = $3;
+ yyDay = $5;
+ } else {
+ yyMonth = $1;
+ yyDay = $3;
+ yyYear = $5;
+ }
}
| tUNUMBER tSNUMBER tSNUMBER {
/* ISO 8601 format. yyyy-mm-dd. */
@@ -643,7 +649,9 @@ Convert(Month, Day, Year, Hours, Minutes, Seconds, Meridian, DSTmode)
if (Year < 0)
Year = -Year;
- if (Year < 100)
+ if (Year < 69)
+ Year += 2000;
+ else if (Year < 100)
Year += 1900;
DaysInMonth[1] = Year % 4 == 0 && (Year % 100 != 0 || Year % 400 == 0)
? 29 : 28;
@@ -957,7 +965,7 @@ get_date(p, now)
}
tm = localtime(&nowtime);
- yyYear = tm->tm_year;
+ yyYear = tm->tm_year + 1900;
yyMonth = tm->tm_mon + 1;
yyDay = tm->tm_mday;
yyTimezone = now->timezone;
OpenPOWER on IntegriCloud