1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-11-23 02:32:54 +00:00
Files
amiga-tz/date.1
Arthur David Olson 0c3a26eaf6 Step 1 in simplification
SCCS-file: date.1
SCCS-SID: 2.1
2012-07-18 03:01:55 -04:00

158 lines
4.1 KiB
Groff

.TH DATE 1
.SH NAME
date \- show and set date and time
.SH SYNOPSIS
.if n .nh
.if n .na
.B date
[
.B \-u
] [
.B \-D
] [
.B \-S
] [
.B \-n
] [
.B \-d
dsttype
] [
.B \-t
minutes-west
] [
.BI + format
] [
\fR[\fIyyyy\fR]\fImmddhhmm\fR[\fIyy\fR][\fB.\fIss\fR]
]
.SH DESCRIPTION
.I Date
without arguments writes the date and time to the standard output in
the form
.ce 1
Wed Mar 8 14:54:40 EST 1989
.br
with
.B EST
replaced by the local time zone's abbreviation
(or by the abbreviation for the time zone specified in the
.B TZ
environment variable if set).
.PP
If a command-line argument starts with a plus sign
.RB (` + '),
the rest of the argument is used as a
.I format
that controls what appears in the output.
In the format, when a percent sign
.RB (` % ')
appears,
it and the character after it are not output,
but rather identify part of the date or time
to be output in a particular way
(or identify a special character to output):
.nf
.if t .in +.5i
.if n .in +2
.ta \w'%M\0\0'u +\w'Wed Mar 8 14:54:40 EST 1989\0\0'u
Sample output Explanation
%a Wed Abbreviated weekday name
%A Wednesday Full weekday name
%b Mar Abbreviated month name
%B March Full month name
%c Wed Mar 8 14:54:40 EST 1989 See above
%d 08 Day of month (always two digits)
%D 03/08/89 Month/day/year (eight characters)
%h Mar Abbreviated month name
%H 14 24-hour-clock hour (two digits)
%I 02 12-hour-clock hour (two digits)
%j 067 Julian day number (three digits)
%m 03 Month number (two digits)
%M 54 Minute (two digits)
%n newline character
%p PM AM/PM designation
%r 14:54:40 PM Hour:minute:second AM/PM designation
%R 14:54 Hour:minute
%S 40 Second (two digits)
%t tab character
%T 14:54:40 Hour:minute:second
%U 10 Sunday-based week number (two digits)
%w 3 Day number (one digit, Sunday is 0)
%W 10 Monday-based week number (two digits)
%x Wed Mar 8 Weekday Month Day
%X 14:54:40 Hour:minute:second
%y 89 Last two digits of year
%Y 1989 Year in full
%Z EST Time zone abbreviation
%% % percent sign
.if t .in -.5i
.if n .in -2
.fi
If a character other than one of those shown above appears after
a percent sign in the format,
.I date\^
produces an error message.
All other characters in the format are copied unchanged to the output;
a newline character is always added at the end of the output.
.PP
In Sunday-based week numbering,
the first Sunday of the year begins week 1;
days preceding it are part of ``week 0.''
In Monday-based week numbering,
the first Monday of the year begins week 1.
.PP
To set the date, use a command line argument with one of the following forms:
.nf
.if t .in +.5i
.if n .in +2
.ta \w'198903081454\0\0'u
1454 24-hour-clock hours (first two digits) and minutes
081454 Month day (first two digits), hours, and minutes
03081454 Month (two digits, January is 01), month day, hours, minutes
8903081454 Year, month, month day, hours, minutes
0308145489 Month, month day, hours, minutes, year
198903081454 Four-digit year, month, month day, hours minutes
.if t .in -.5i
.if n .in -2
.fi
If the century, year, month, or month day is not given,
the current value is used.
Any of the above forms may be followed by a period and two digits that give
the seconds part of the new time; if no seconds are given, zero is assumed.
.PP
These options are available:
.TP
.B \-u
Use GMT when setting and showing the date and time.
.TP
.B \-D
Take the command-line time to be Daylight Saving Time.
Either this or the
.B \-S
option must be used in the witching hour(s) of days when clocks are
turned back.
.TP
.B \-S
Take the the command-line time to be Standard Time.
.TP
.B \-n
Do not notify other networked systems of the time change.
.TP
.BI "\-d " dsttype
Set the kernel-stored Daylight Saving Time type to the given value.
The kernel-stored DST type is used mostly by ``old'' binaries;
this option
(as well as the
.B \-t
option) is only available on systems that store such information.
.TP
.BI "\-t " minutes-west
Set the kernel-stored ``minutes west of GMT'' value to the one given on the
command line.
.SH NOTE
In some parts of the year,
avoid setting the time within a minute of noon if your area uses
solar time.
There's no way to specify which of two near-noon times you want
since they're both ``standard.''
.. %W%