mirror of
https://git.FreeBSD.org/src.git
synced 2024-10-19 02:29:40 +00:00
date.1: Fix some style issues and examples
- Use Cm instead of Ar or Sq for command modifiers of the -v flag.
- Remove unnecessary "Ar ..." from the synopsis. It's not clear what it
was referring to.
- Add missing arguments to the -f and -v flags.
- Stylize the dot before "ss" with Cm in the default format in the -f
flag description.
- Set LC_ALL=C in the last example so that the output format of
date(1) always matches the specified format of the -f flag not matter
the locale.
- List the -f flag as optional in all usage lines in the synopsis.
MFC after: 3 days
(cherry picked from commit 00133d5c5e
)
This commit is contained in:
parent
513348e821
commit
5bee300aef
@ -32,7 +32,7 @@
|
|||||||
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
.\" @(#)date.1 8.3 (Berkeley) 4/28/95
|
||||||
.\" $FreeBSD$
|
.\" $FreeBSD$
|
||||||
.\"
|
.\"
|
||||||
.Dd August 25, 2020
|
.Dd November 3, 2021
|
||||||
.Dt DATE 1
|
.Dt DATE 1
|
||||||
.Os
|
.Os
|
||||||
.Sh NAME
|
.Sh NAME
|
||||||
@ -49,10 +49,9 @@
|
|||||||
.Sm off
|
.Sm off
|
||||||
.Fl v
|
.Fl v
|
||||||
.Op Cm + | -
|
.Op Cm + | -
|
||||||
.Ar val Op Ar ymwdHMS
|
.Ar val Op Cm y | m | w | d | H | M | S
|
||||||
.Sm on
|
.Sm on
|
||||||
.Oc
|
.Oc
|
||||||
.Ar ...
|
|
||||||
.Op Cm + Ns Ar output_fmt
|
.Op Cm + Ns Ar output_fmt
|
||||||
.\" Set time with the default input format.
|
.\" Set time with the default input format.
|
||||||
.Nm
|
.Nm
|
||||||
@ -111,7 +110,7 @@ the time may not be changed by more than 1 second.
|
|||||||
.Pp
|
.Pp
|
||||||
The options are as follows:
|
The options are as follows:
|
||||||
.Bl -tag -width Ds
|
.Bl -tag -width Ds
|
||||||
.It Fl f
|
.It Fl f Ar input_fmt
|
||||||
Use
|
Use
|
||||||
.Ar input_fmt
|
.Ar input_fmt
|
||||||
as the format string to parse the
|
as the format string to parse the
|
||||||
@ -124,7 +123,7 @@ provided rather than using the default
|
|||||||
.Ar mm Oc
|
.Ar mm Oc
|
||||||
.Ar dd Oc
|
.Ar dd Oc
|
||||||
.Ar HH
|
.Ar HH
|
||||||
.Oc Ar MM Op Ar .ss
|
.Oc Ar MM Op Cm \&. Ar ss
|
||||||
.Sm on
|
.Sm on
|
||||||
format.
|
format.
|
||||||
Parsing is done using
|
Parsing is done using
|
||||||
@ -135,24 +134,24 @@ Use
|
|||||||
output format.
|
output format.
|
||||||
.Ar FMT
|
.Ar FMT
|
||||||
may be omitted, in which case the default is
|
may be omitted, in which case the default is
|
||||||
.Sq date .
|
.Cm date .
|
||||||
Valid
|
Valid
|
||||||
.Ar FMT
|
.Ar FMT
|
||||||
values are
|
values are
|
||||||
.Sq date ,
|
.Cm date ,
|
||||||
.Sq hours ,
|
.Cm hours ,
|
||||||
.Sq minutes ,
|
.Cm minutes ,
|
||||||
and
|
and
|
||||||
.Sq seconds .
|
.Cm seconds .
|
||||||
The date and time is formatted to the specified precision.
|
The date and time is formatted to the specified precision.
|
||||||
When
|
When
|
||||||
.Ar FMT
|
.Ar FMT
|
||||||
is
|
is
|
||||||
.Sq hours
|
.Cm hours
|
||||||
(or the more precise
|
(or the more precise
|
||||||
.Sq minutes
|
.Cm minutes
|
||||||
or
|
or
|
||||||
.Sq seconds ) ,
|
.Cm seconds ) ,
|
||||||
the
|
the
|
||||||
.St -iso8601
|
.St -iso8601
|
||||||
format includes the timezone.
|
format includes the timezone.
|
||||||
@ -196,7 +195,13 @@ Print the date and time of the last modification of
|
|||||||
Display or set the date in
|
Display or set the date in
|
||||||
.Tn UTC
|
.Tn UTC
|
||||||
(Coordinated Universal) time.
|
(Coordinated Universal) time.
|
||||||
.It Fl v
|
.It Xo
|
||||||
|
.Fl v
|
||||||
|
.Sm off
|
||||||
|
.Op Cm + | -
|
||||||
|
.Ar val Op Cm y | m | w | d | H | M | S
|
||||||
|
.Sm on
|
||||||
|
.Xc
|
||||||
Adjust (i.e., take the current date and display the result of the
|
Adjust (i.e., take the current date and display the result of the
|
||||||
adjustment; not actually set the date) the second, minute, hour, month
|
adjustment; not actually set the date) the second, minute, hour, month
|
||||||
day, week day, month or year according to
|
day, week day, month or year according to
|
||||||
@ -220,14 +225,14 @@ and years are in the range 80-38 or 1980-2038.
|
|||||||
If
|
If
|
||||||
.Ar val
|
.Ar val
|
||||||
is numeric, one of either
|
is numeric, one of either
|
||||||
.Ar y ,
|
.Cm y ,
|
||||||
.Ar m ,
|
.Cm m ,
|
||||||
.Ar w ,
|
.Cm w ,
|
||||||
.Ar d ,
|
.Cm d ,
|
||||||
.Ar H ,
|
.Cm H ,
|
||||||
.Ar M
|
.Cm M
|
||||||
or
|
or
|
||||||
.Ar S
|
.Cm S
|
||||||
must be used to specify which part of the date is to be adjusted.
|
must be used to specify which part of the date is to be adjusted.
|
||||||
.Pp
|
.Pp
|
||||||
The week day or month may be specified using a name rather than a
|
The week day or month may be specified using a name rather than a
|
||||||
@ -441,7 +446,7 @@ will display
|
|||||||
.Pp
|
.Pp
|
||||||
Finally the command:
|
Finally the command:
|
||||||
.Pp
|
.Pp
|
||||||
.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`date`"" ""+%s"""
|
.Dl "date -j -f ""%a %b %d %T %Z %Y"" ""`LC_ALL=C date`"" ""+%s"""
|
||||||
.Pp
|
.Pp
|
||||||
can be used to parse the output from
|
can be used to parse the output from
|
||||||
.Nm
|
.Nm
|
||||||
|
Loading…
Reference in New Issue
Block a user