date.1.in (1707B)
- .\" utils-std: Collection of commonly available Unix tools
- .\" Copyright 2017 Haelwenn (lanodan) Monnier <contact+utils@hacktivis.me>
- .\" SPDX-License-Identifier: MPL-2.0
- .Dd 2023-06-03
- .Dt DATE 1
- .Os
- .Sh NAME
- .Nm date
- .Nd display date and time
- .Sh SYNOPSIS
- .Nm
- .Op Fl uR
- .Op Fl d Ar datetime
- .Op Cm + Ns Ar format
- .Nm
- .Op Fl uR
- .Fl f Ar now_format
- .Ar now
- .Op Cm + Ns Ar format
- .Sh DESCRIPTION
- When
- .Nm
- is invoked without arguments it displays the current datetime
- Otherwise, depending on the options specified, will print the datetime in a user-defined way.
- .Sh OPTIONS
- .Bl -tag -width Ds
- .It Fl d Ar datetime
- Use
- .Ar datetime
- instead of current datetime.
- include(lib/iso_parse.mdoc)
- .It Fl f Ar now_format
- Use
- .Ar now_format
- as the
- .Xr strptime 3
- format string for
- .Ar now ,
- which will be used instead of the current datetime.
- .It Fl u
- Use UTC (coordinated universal time) instead of the local time.
- .It Fl R
- Set the default value of
- .Ar format
- to match RFC5322 (Internet Message Format).
- .It Cm + Ns Ar format
- Set the displayed datetime in
- .Xr strftime 3
- format.
- Otherwise defaults to
- .Ql %c
- .El
- .Sh ENVIRONMENT
- Look at the manual page of
- .Xr strftime 3
- for the environment variables, typical ones are
- .Ev TZ ,
- .Ev LC_TIME
- and
- .Ev LC_ALL
- but this depends on your system.
- .Sh EXIT STATUS
- .Ex -std
- .Sh SEE ALSO
- .Xr strftime 3
- .Sh STANDARDS
- Except for the lack of setting the system date and time,
- .Nm
- is compliant with the
- .St -p1003.1-2008
- specification.
- .Pp
- The
- .Fl d
- and
- .Fl R
- options are present for compatibility with other modern systems such as
- NetBSD, BusyBox, and GNU coreutils.
- The
- .Fl f
- option is inspired by NetBSD.
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+utils@hacktivis.me