Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ date(1) — GL2 W3.6

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

timed(1M)

DATE(1)  —  Silicon Graphics

NAME

date − print and set the date

SYNOPSIS

date [ +format ]
date [ −n ] mmddhhmm[.ss][yy]

DESCRIPTION

If no argument is given, or if the argument begins with +, the current date and time are printed.  Otherwise, the current date is set.  The first mm is the month number; dd is the day number in the month; hh is the hour number (24 hour system); the second mm is the minute number; ss is the second number, which must be preceded with a period, and is optional; yy is the last 2 digits of the year number and is optional.  The current year is the default if no year is mentioned. 

If timed(1M) is running on the machine, the date is set on all machines in the network which are also running timed. However, the −n flag means “no network”, i.e., it does not set the date for all the machines on the network.  The system operates in GMT; date takes care of the conversion to and from local standard and daylight 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

z abbreviated time-zone, lower-case

Z abbreviated time-zone, upper-case

EXAMPLES

date −n 10080045.1787

sets the date on the local machine only to Oct 8, 12:45:17 AM, 1987.  Issuing

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

immediately afterwards generates the output:

DATE: 10/08/87
TIME: 12:45:20

DIAGNOSTICS

No permission if you aren’t the super-user and you try to change the date;

bad conversion if the date set is syntactically incorrect;

bad format character if the field descriptor is not recognizable. 

FILES

/dev/kmem

SEE ALSO

timed(1M). 

WARNING

It is a bad practice to change the date while the system is running multi-user. 

Version 3.6  —  December 20, 1987

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