Museum

Home

Lab Overview

Retrotechnology Articles

Online Manuals

⇒ date(1V) — RISC iX 1.2

Media Vault

Software Library

Restoration Projects

Artifacts Sought

Related Articles

date(1)

DATE(1V)  —  UNIX Programmer’s Manual

NAME

date − print the date. 

SYNOPSIS

/usr/5bin/date mmddhhmm[yy]
/usr/5bin/date [+format]

DESCRIPTION

Date prints out the current time and date if no argument is given. 

If an argument is given of the form mmddhhmm[yy], date attempts to set the system time to the value given in the argument.  The setting of the system date is only possible if the user has appropriate privileges and the system allows the setting of the system date. 

The argument is broken down as follows.  The first mm is the month (01-12); dd is the day (01-31); hh is the hour (00-23); the second mm is the minute (00-59) and yy is the last two digits of the year and is optional. 

For example: date 10080045 sets the date to October 8, 00:45. If yy is omitted then the current year is the default. 

The system operates in GMT; date takes care of the conversion to and from local time.  It is possible to override the default timezone using the environment variable TZ, see ctime(). 

If the argument given begins with a +, date’s output is under the control of the user.  The output format is similar to the first argument in the printf() function.  All output fields are of fixed size (padded with zeros if necessary).  Each field descriptor is preceded by a % character and will be replaced in the output by its corresponding value.  A single % can be introduced into the output character stream  with %%.  All other characters are copied to the output without change The string will always be terminated with a newline character.  Field descriptors:

a abbreviated weekday name. 

A full weekday name. 

b abbreviated month name. 

B full month name. 

c current date and time representation. 

d day of month - [01,31]. 

D date as %m/%d/%y

h abbreviated month name. 

H hour - [00,23]

I hour - [00-12]

j day of year - [001,366]

m month of year - [01,12]

M minute - [00,59]

n insert a newline character. 

p am or pm. 

r time in am//pm notation. 

S second - [00,61]

t insert a tab character. 

T time as %H:%M:%S

U week number of the year (Sunday being classed as the first day of the week) as a decimal number [00,53]

w day of week [0,6] (Sunday = day 0)

W week number of the year (Monday being classed as the first day of the week) as a decimal number [00,53]

x current date representation. 

X current time representation. 

y last two digits of year - [00,99]

Y year with century as a decimal number. 

Z timezone name, or no characters if timezone doesn’t exist. 

This utility operates in an 8-bit transparent manner. 

EXAMPLE

This argument date ’+THE DATE TODAY IS: %a %d %B %Y%nTHE TIME IS: %T’ generates the following output THE DATE TODAY IS: Mon 8 October 1990
THE TIME IS: 19:27:52

SEE ALSO

date(1). 

BUGS

If the output stream is greater than 200 characters long then there will be no output displayed. 

4th Berkeley Distribution

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