remove obsolete -d and -t options -- kernel timezone handling is long gone

This commit is contained in:
perry 1997-01-24 18:17:17 +00:00
parent 633ceb6db5
commit 61974fdce1
2 changed files with 5 additions and 44 deletions

View File

@ -1,4 +1,4 @@
.\" $NetBSD: date.1,v 1.12 1996/03/12 04:32:37 phil Exp $
.\" $NetBSD: date.1,v 1.13 1997/01/24 18:17:18 perry Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
@ -44,9 +44,7 @@
.Nd display or set date and time
.Sh SYNOPSIS
.Nm date
.Op Fl d Ar dst
.Op Fl r Ar seconds
.Op Fl t Ar minutes_west
.Op Fl nu
.Op Cm + Ns Ar format
.Op [yy[mm[dd[hh]]]]mm[\&.ss]
@ -59,15 +57,6 @@ Only the superuser may set the date.
.Pp
The options are as follows:
.Bl -tag -width Ds
.It Fl d
Set the kernel's value for daylight savings time.
If
.Ar dst
is non-zero, future calls
to
.Xr gettimeofday 2
will return a non-zero
.Ql tz_dsttime .
.It Fl n
The utility
.Xr timed 8
@ -86,14 +75,6 @@ from setting the time for other than the current machine.
Print out the date and time in
.Ar seconds
from the Epoch.
.It Fl t
Set the kernel's value for minutes west of
.Tn GMT .
.Ar Minutes_west
specifies the number of minutes returned in
.Ql tz_minuteswest
by future calls to
.Xr gettimeofday 2 .
.It Fl u
Display or set the date in
.Tn UCT

View File

@ -1,4 +1,4 @@
/* $NetBSD: date.c,v 1.12 1997/01/09 16:31:05 tls Exp $ */
/* $NetBSD: date.c,v 1.13 1997/01/24 18:17:17 perry Exp $ */
/*
* Copyright (c) 1985, 1987, 1988, 1993
@ -43,7 +43,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
#else
static char rcsid[] = "$NetBSD: date.c,v 1.12 1997/01/09 16:31:05 tls Exp $";
static char rcsid[] = "$NetBSD: date.c,v 1.13 1997/01/24 18:17:17 perry Exp $";
#endif
#endif /* not lint */
@ -78,19 +78,14 @@ main(argc, argv)
{
extern int optind;
extern char *optarg;
struct timezone tz;
int ch, rflag;
char *format, buf[1024];
setlocale(LC_ALL, "");
tz.tz_dsttime = tz.tz_minuteswest = 0;
rflag = 0;
while ((ch = getopt(argc, argv, "d:nr:ut:")) != -1)
while ((ch = getopt(argc, argv, "nr:u")) != -1)
switch((char)ch) {
case 'd': /* daylight savings time */
tz.tz_dsttime = atoi(optarg) ? 1 : 0;
break;
case 'n': /* don't set network */
nflag = 1;
break;
@ -101,27 +96,12 @@ main(argc, argv)
case 'u': /* do everything in GMT */
(void)setenv("TZ", "GMT0", 1);
break;
case 't': /* minutes west of GMT */
/* error check; don't allow "PST" */
if (isdigit(*optarg)) {
tz.tz_minuteswest = atoi(optarg);
break;
}
/* FALLTHROUGH */
default:
usage();
}
argc -= optind;
argv += optind;
/*
* If -d or -t, set the timezone or daylight savings time; this
* doesn't belong here, there kernel should not know about either.
*/
if ((tz.tz_minuteswest || tz.tz_dsttime) &&
settimeofday(NULL, &tz))
err(1, "settimeofday");
if (!rflag && time(&tval) == -1)
err(1, "time");
@ -240,7 +220,7 @@ static void
usage()
{
(void)fprintf(stderr,
"usage: date [-nu] [-d dst] [-r seconds] [-t west] [+format]\n");
"usage: date [-nu] [-r seconds] [+format]\n");
(void)fprintf(stderr, " [yy[mm[dd[hh]]]]mm[.ss]]\n");
exit(1);
}