Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ date(1V) — NEWS-os 4.2.1R

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

gettimeofday(2)

utmp(5)

timed(8)

DATE(1V)  —  NEWS-OS Programmer’s Manual

NAME

date − print and set the date

SYNOPSIS

date [ −n ] [ −u ] [ yymmddhhmm[.ss] ] [ +format ]
/usr/5bin/date [ −n ] [ −u ] [ mmddhhmm[yy] ] [ +format ]

DESCRIPTION

If no arguments are given, or if the argument begins with +, the current date and time are printed.  Otherwise, date will set the desired date.  Only the superuser can set the date.  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.  Only the year may be omitted when using /usr/5bin/date.  The system operates in GMT.  date takes care of the conversion to and from local standard and daylight-saving time. 

If the argument begins with +, the output of date is under the control of the user.  The format for the output is similar to that of the first argument to printf(3S).  All output fields are of fixed size (zero padded if necessary).  Each field descriptor is preceded by % and will be replaced in the output by its corresponding value.  A single % is encoded by %%.  All other characters are copied to the output without change.  The string is always terminated with a new-line character. 

Field Descriptors:

n insert a new-line character

t insert a tab character

m month of year − 01 to 12

d day of month − 01 to 31

y last 2 digits of year − 00 to 99

D date as mm/dd/yy

H hour − 00 to 23

M minute − 00 to 59

S second − 00 to 59

T time as HH:MM:SS

j day of year − 001 to 366

w day of week − Sunday = 0

a abbreviated weekday − Sun to Sat

h abbreviated month − Jan to Dec

r time in AM/PM notation

EXAMPLE

date ′+DATE: %m/%d/%y%nTIME: %H:%M:%S′

would have generated as output:

DATE: 08/01/76
TIME: 14:45:05

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/wtmpto record time-setting.
/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.

Network time being set
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 this message. 

Communication error with timed
The communication between date and timed fails. 

NEWS-OSRelease 4.2.1R

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