summaryrefslogtreecommitdiff
path: root/bin/date/date.c
diff options
context:
space:
mode:
authorDavid Leonard <d@cvs.openbsd.org>1999-02-01 07:52:10 +0000
committerDavid Leonard <d@cvs.openbsd.org>1999-02-01 07:52:10 +0000
commita9512f45e01d15c691dfe191dfd827041066f0de (patch)
tree46a6071f4888ad18469673f33f3dfcf6796ce2e8 /bin/date/date.c
parent2404d9d6f357b29d9e44a24d13b5e4db56ae8a28 (diff)
GMT -> UTC in comments; make y2k hack easier to read
Diffstat (limited to 'bin/date/date.c')
-rw-r--r--bin/date/date.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/bin/date/date.c b/bin/date/date.c
index a8d57374ff9..8a743363f4c 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: date.c,v 1.12 1999/01/02 08:24:51 weingart Exp $ */
+/* $OpenBSD: date.c,v 1.13 1999/02/01 07:52:09 d Exp $ */
/* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: date.c,v 1.12 1999/01/02 08:24:51 weingart Exp $";
+static char rcsid[] = "$OpenBSD: date.c,v 1.13 1999/02/01 07:52:09 d Exp $";
#endif
#endif /* not lint */
@@ -100,7 +100,7 @@ main(argc, argv)
rflag = 1;
tval = atol(optarg);
break;
- case 'u': /* do everything in GMT */
+ case 'u': /* do everything in UTC */
(void)setenv("TZ", "GMT0", 1);
break;
case 't': /* minutes west of GMT */
@@ -182,7 +182,7 @@ setthetime(p)
lt->tm_sec = 0;
switch (strlen(p)) {
- case 12: /* yyyy */
+ case 12: /* cc */
bigyear = ATOI2(p);
lt->tm_year = bigyear * 100 - TM_YEAR_BASE;
yearset = 1;
@@ -192,9 +192,10 @@ setthetime(p)
lt->tm_year += ATOI2(p);
} else {
lt->tm_year = ATOI2(p);
- lt->tm_year += (1900 - TM_YEAR_BASE);
if (lt->tm_year < 69) /* hack for 2000 ;-} */
- lt->tm_year += 100;
+ lt->tm_year += (2000 - TM_YEAR_BASE);
+ else
+ lt->tm_year += (1900 - TM_YEAR_BASE);
}
/* FALLTHROUGH */
case 8: /* mm */
@@ -222,7 +223,7 @@ setthetime(p)
badformat();
}
- /* convert broken-down time to GMT clock time */
+ /* convert broken-down time to UTC clock time */
if ((tval = mktime(lt)) < 0)
errx(1, "specified date is outside allowed range");