Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ date(1) — NEXTSTEP 1.0

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gettimeofday(2)

utmp(5)

timed(8)

DATE(1)  —  UNIX Programmer’s Manual

NAME

date − print and set the date

SYNOPSIS

date [ -n ] [ -u ] [-d dst] [-t timezone] [ yymmddhhmm[.ss] ]

DESCRIPTION

If no arguments are given, the current date and time are printed.  Providing an argument will set the desired date.  Only the superuser can set the date. 

The −d flag sets whether or not time on the machine is in daylight savings mode.  A 1 following the −d sets the machine to daylight savings time.  The −t flag sets the timezone to  be timezone number of minutes west of GMT.  The −u flag is used to display or set the date in GMT (universal) time.  yy represents the last two digits of the year; the first mm is the month number; dd is the day number; hh is the hour number (24 hour system); the second mm is the minute number; .ss is optional and represents the seconds.  For example:

date 8506131627

sets the date to June 13 1985, 4:27 PM.  The year, month and day may be omitted; the default values will be the current ones.  The system operates in GMT.  Date takes care of the conversion to and from local standard and daylight-saving time. 

If timed(8) is running to synchronize the clocks of machines in a local area network, date sets the time globally on all those machines unless the −n option is given. 

FILES

/usr/adm/wtmp to record time-setting.  In /usr/adm/messages, date records the name of the user setting the time. 

SEE ALSO

gettimeofday(2), utmp(5), timed(8),
TSP: The Time Synchronization Protocol for UNIX 4.3BSD, R. Gusella and S. Zatti

DIAGNOSTICS

Exit status is 0 on success, 1 on complete failure to set the date, and 2 on successfully setting the local date but failing globally. 

‘You are not superuser: date not set’ if you try to change the date but are not the super-user.  Occasionally, when timed synchronizes the time on many hosts, the setting of a new time value may require more than a few seconds.  On these occasions, date prints: ‘Network time being set’.  The message ‘Communication error with timed’ occurs when the communication between date and timed fails. 

BUGS

The system attempts to keep the date in a format closely compatible with VMS.  VMS, however, uses local time (rather than GMT) and does not understand daylight-saving time.  Thus, if you use both UNIX and VMS, VMS will be running on GMT. 

4th Berkeley Distribution  —  May 18, 1986

Typewritten Software • bear@typewritten.org • Edmonds, WA 98026