1
0
mirror of https://github.com/openbsd/src.git synced 2025-01-04 23:35:36 -08:00

use the same format/text, as far as possible, for date strings;

help/ok guenther millert
This commit is contained in:
jmc 2011-08-31 08:48:40 +00:00
parent 982d0bf78a
commit dc2cf4e428
4 changed files with 73 additions and 73 deletions

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: date.1,v 1.58 2011/07/08 06:54:11 jmc Exp $
.\" $OpenBSD: date.1,v 1.59 2011/08/31 08:48:40 jmc Exp $
.\" $NetBSD: date.1,v 1.12 1996/03/12 04:32:37 phil Exp $
.\"
.\" Copyright (c) 1980, 1990, 1993
@ -33,7 +33,7 @@
.\"
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
.\"
.Dd $Mdocdate: July 8 2011 $
.Dd $Mdocdate: August 31 2011 $
.Dt DATE 1
.Os
.Sh NAME
@ -54,7 +54,7 @@
.Ar mm Oc
.Ar dd Oc
.Ar HH Oc
.Ar MM Op Ar \&.SS
.Ar MM Op No \&. Ns Ar SS
.Oc
.Sm on
.Sh DESCRIPTION
@ -135,19 +135,27 @@ The canonical representation for setting the date and time is:
.Pp
.Bl -tag -width Ds -compact -offset indent
.It Ar ccyy
Year:
the first two digits (representing the century) may be omitted
for non-ambiguous years (1969\-2068).
Year.
If yy is specified, but cc is not,
a value for yy between 69 and 99 results in a cc value of 19.
Otherwise, a cc value of 20 is used.
.It Ar mm
Numeric month: a number from 1 to 12.
Month:
a number from 1 to 12.
.It Ar dd
Day: a number from 1 to 31.
Day:
a number from 1 to 31.
.It Ar HH
Hour: a number from 0 to 23.
Hour:
a number from 0 to 23.
.It Ar MM
Minute: a number from 0 to 59.
Minute:
a number from 0 to 59.
.It Ar SS
Second: a number from 0 to 61 (59 plus a maximum of two leap seconds).
Second:
a number from 0 to 60
(permitting a leap second),
preceded by a period.
.El
.Pp
Everything but the minute is optional.

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: ls.1,v 1.65 2011/03/05 15:57:03 jmc Exp $
.\" $OpenBSD: ls.1,v 1.66 2011/08/31 08:48:40 jmc Exp $
.\" $NetBSD: ls.1,v 1.14 1995/12/05 02:44:01 jtc Exp $
.\"
.\" Copyright (c) 1980, 1990, 1991, 1993, 1994
@ -33,7 +33,7 @@
.\"
.\" @(#)ls.1 8.7 (Berkeley) 7/29/94
.\"
.Dd $Mdocdate: March 5 2011 $
.Dd $Mdocdate: August 31 2011 $
.Dt LS 1
.Os
.Sh NAME
@ -304,7 +304,7 @@ If the
.Fl T
option is given, the time of last modification is displayed using the
format
.Dq mmm dd HH:MM:SS CCYY .
.Dq mmm dd HH:MM:SS ccyy .
.Pp
If the file is a symbolic link, the pathname of the
linked-to file is preceded by

View File

@ -1,4 +1,4 @@
.\" $OpenBSD: touch.1,v 1.23 2011/08/28 22:54:05 jmc Exp $
.\" $OpenBSD: touch.1,v 1.24 2011/08/31 08:48:40 jmc Exp $
.\" $NetBSD: touch.1,v 1.8 1995/08/31 22:10:05 jtc Exp $
.\"
.\" Copyright (c) 1991, 1993
@ -33,7 +33,7 @@
.\"
.\" @(#)touch.1 8.3 (Berkeley) 4/28/95
.\"
.Dd $Mdocdate: August 28 2011 $
.Dd $Mdocdate: August 31 2011 $
.Dt TOUCH 1
.Os
.Sh NAME
@ -43,10 +43,10 @@
.Nm touch
.Op Fl acm
.Sm off
.Op Fl "d " Ar YYYY No - Ar MM No - Ar DDThh : Ar mm : Ar SS Oo \&. Ar frac Oc Op Ar Z
.Op Fl "d " Ar ccyy No - Ar mm No - Ar ddTHH : Ar MM : Ar SS Oo \&. Ar frac Oc Op Ar Z
.Sm on
.Op Fl r Ar file
.Op Fl t Oo Ns Oo Ar CC Oc Ns Ar YY Oc Ns Ar MMDDhhmm Ns Op \&. Ns Ar SS
.Op Fl t Oo Ns Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS
.Ar
.Sh DESCRIPTION
The
@ -69,31 +69,37 @@ The
utility does not treat this as an error.
No error messages are displayed and the exit value is not affected.
.Sm off
.It Fl "d " Ar YYYY No - Ar MM No - Ar DDThh : Ar mm : Ar SS Oo \&. Ar frac Oc Op Ar Z
.It Fl "d " Ar ccyy No - Ar mm No - Ar ddTHH : Ar MM : Ar SS Oo \&. Ar frac Oc Op Ar Z
.Sm on
Change the access and modification times to the specified time.
The argument should be of the form
YYYY-MM-DDThh:mm:SS[.frac][Z],
ccyy-mm-ddTHH:MM:SS[.frac][Z],
where the parts of the argument represent the following:
.Pp
.Bl -tag -width .frac -compact -offset indent
.It Ar YYYY
The four digits of the year.
.It Ar MM
The month of the year, from 1 to 12.
.It Ar DD
The day of the month, from 1 to 31.
.It Ar ccyy
Year.
.It Ar mm
Month:
a number from 1 to 12.
.It Ar dd
Day:
a number from 1 to 31.
.It Ar T
Either the capital letter
.Sq T
or a single space.
.It Ar hh
The hour of the day, from 0 to 23.
.It Ar mm
The minute of the hour, from 0 to 59.
.It Ar HH
Hour:
a number from 0 to 23.
.It Ar MM
Minute:
a number from 0 to 59.
.It Ar SS
The second of the minute, from 0 to 60.
.It No \&. Ns Ar frac
Second:
a number from 0 to 60
(permitting a leap second).
.It Ar frac
The decimal fraction of the second,
either a period or comma,
followed by one or more decimal digits.
@ -111,51 +117,37 @@ flag is also specified.
.It Fl r Ar file
Use the access and modification times from the specified file
instead of the current time of day.
.It Fl t Oo Ns Oo Ar CC Oc Ns Ar YY Oc Ns Ar MMDDhhmm Ns Op \&. Ns Ar SS
.It Fl t Oo Ns Oo Ar cc Oc Ns Ar yy Oc Ns Ar mmddHHMM Ns Op \&. Ns Ar SS
Change the access and modification times to the specified time.
The argument should be of the form
[[CC]YY]MMDDhhmm[.SS],
[[cc]yy]mmddHHMM[.SS],
where the parts of the argument represent the following:
.Pp
.Bl -tag -width Ds -compact -offset indent
.It Ar CC
The first two digits of the year (the century).
.It Ar YY
The second two digits of the year.
If
.Dq YY
is specified, but
.Dq CC
is not, a value for
.Dq YY
between 69 and 99 results in a
.Dq CC
value of 19.
Otherwise, a
.Dq CC
value of 20 is used.
.It Ar MM
The month of the year, from 1 to 12.
.It Ar DD
The day of the month, from 1 to 31.
.It Ar hh
The hour of the day, from 0 to 23.
.It Ar ccyy
Year.
If yy is specified, but cc is not,
a value for yy between 69 and 99 results in a cc value of 19.
Otherwise, a cc value of 20 is used.
.It Ar mm
The minute of the hour, from 0 to 59.
.It No \&. Ns Ar SS
The second of the minute, from 0 to 60,
Month:
a number from 1 to 12.
.It Ar dd
Day:
a number from 1 to 31.
.It Ar HH
Hour:
a number from 0 to 23.
.It Ar MM
Minute:
a number from 0 to 59.
.It Ar SS
Second:
a number from 0 to 60
(permitting a leap second),
preceded by a period.
The default is 0.
.El
.Pp
If the
.Dq CC
and
.Dq YY
letter pairs are not specified, the values default to the current
year.
If the
.Dq SS
letter pair is not specified, the value defaults to 0.
.El
.Sh EXIT STATUS
.Ex -std touch
@ -178,7 +170,7 @@ or
option is specified, there are at least two arguments, and the first
argument is a string of digits either eight or ten characters in length,
the first argument is interpreted as a time specification of the form
.Dq MMDDhhmm[YY] .
.Dq mmddHHMM[yy] .
.Sh HISTORY
A
.Nm

View File

@ -1,4 +1,4 @@
/* $OpenBSD: touch.c,v 1.20 2011/08/30 02:07:11 guenther Exp $ */
/* $OpenBSD: touch.c,v 1.21 2011/08/31 08:48:40 jmc Exp $ */
/* $NetBSD: touch.c,v 1.11 1995/08/31 22:10:06 jtc Exp $ */
/*
@ -326,7 +326,7 @@ __dead void
usage(void)
{
(void)fprintf(stderr,
"usage: touch [-acm] [-d YYYY-MM-DDThh:mm:SS[.frac][Z]] [-r file]\n"
" [-t [[CC]YY]MMDDhhmm[.SS]] file ...\n");
"usage: touch [-acm] [-d ccyy-mm-ddTHH:MM:SS[.frac][Z]] [-r file]\n"
" [-t [[cc]yy]mmddHHMM[.SS]] file ...\n");
exit(1);
}