date.1x (2603B)
- .\" This file is part of Cross Unix Documentation
- .\" Copyright © 2019-2020 Haelwenn (lanodan) Monnier <contact@hacktivis.me>
- .\" SPDX-License-Identifier: CC-BY-4.0
- .Dd 2019-03-03
- .Dt DATE 1x
- .Os
- .Sh PROLOG
- This manual page is part of
- .Lk https://hacktivis.me/git/cross-unix-documentation "Cross-Unix Documentation"
- which is an attempt to provide documentation of similarities and (noteworthy) differencies between Unix-like systems.
- To be used as an addition to the POSIX standard.
- .Sh NAME
- .Nm date
- .Nd display or set the date and time
- .Sh SYNOPSIS
- .Nm
- .Op Fl u
- .Op Fl d Ar date
- .Op Ar +format
- .Nm
- .Op Fl u
- setdate
- .Sh DESCRIPTION
- .Bl -tag -width Ds
- .It Fl u
- Use UTC
- .It Fl d Ar date
- Use
- .Ar date
- instead of current datetime (aka now). Absent for POSIX, present for
- .Nx ,
- .Fx ,
- .Ox ,
- GNU coreutils,
- BusyBox.
- .El
- .Ss +format
- It is mostly similar to
- .Xr strftime 3
- but it actually presents some differencies, for example POSIX doesn't put the usual (
- .Nx ,
- .Fx ,
- .Ox ,
- GNU coreutils, BusyBox) %s for seconds since 1970-01-01 00:00:00 UTC (aka Unix Epoch) into
- .Xr date 1
- but it is present into
- .Xr strftime 3 .
- Not sure if this is a bug into the specification or not.
- .Pp
- .Nx ,
- .Fx ,
- .Ox
- just gives
- .Ar format
- to
- .Xr strftime 3 .
- .Ss setdate format
- The heck they managed to put in their manpage, followed by
- .Xr strftime 3
- format with reusing option formatting.
- .Bl -tag -width 6n
- .It POSIX
- .Sm off
- .Ar mmddhhmm
- .Oo
- .Ar cc
- .Op Ar yy
- .Oc
- .Sm on
- which makes it
- .Sm off
- .Ar %m%d%H%M
- .Oo
- .Ar \&%C
- .Op Ar %y
- .Oc
- .Sm on
- .It Nx , Fx , Ox
- .Sm off
- .Oo Oo Oo Oo Oo
- .Ar CC Oc
- .Ar yy Oc
- .Ar mm Oc
- .Ar dd Oc
- .Ar HH Oc Ar MM Oo
- .Li \&. Ar SS Oc
- .Sm on
- which makes it
- .Sm off
- .Oo Oo Oo Oo Oo
- .Ar \&%C Oc
- .Ar %y Oc
- .Ar %m Oc
- .Ar %d Oc
- .Ar %H Oc Ar %M Oo
- .Li \&. Ar %S Oc
- .Sm on
- .It GNU
- .Sm off
- .Ar MMDDhhmm
- .Oo
- .Ar CC
- .Op Ar YY
- .Oc
- .Op Ar .ss
- .Sm on
- which makes it
- .Sm off
- .Ar %m%d%H%M
- .Oo
- .Ar \&%C
- .Op Ar %y
- .Oc
- .Op Ar .%S
- .Sm on
- .It BusyBox
- Recognized formats:
- .Sm off
- .Bl -item -compact
- .It
- .Ar hh:mm
- .Op Ar :ss
- .It
- .Op Ar YYYY\&.
- .Ar MM.DD-hh:mm
- .Op Ar :ss
- .It
- .Sm on
- .Ar YYYY-MM-DD
- .Sm off
- .Ar hh:mm
- .Op Ar :ss
- .It
- .Oo Oo Oo Oo Oo
- .Ar YY Oc
- .Ar YY Oc
- .Ar MM Oc
- .Ar DD Oc
- .Ar hh Oc
- .Ar mm
- .Op Ar .ss
- .Sm on
- .El
- .It At v6
- .Sm off
- .Ar mmddhhmm
- .Op Ar yy
- .Sm on
- which makes it
- .Sm off
- .Ar %m%d%H%M
- .Op Ar %y
- .Sm on
- .It At v10 , Bx 4.2
- .Sm off
- .Ar yymmddhhmm
- .Op Ar .ss
- .Sm on
- which makes it
- .Sm off
- .Ar %y%m%d%H%M
- .Op Ar .%S
- .Sm on
- .El
- .Sh SOURCE
- .Nx 8.0 ,
- .Fx 12.0 ,
- .Ox 6.4 ,
- GNU coreutils 8.30,
- BusyBox 1.30.1,
- .At v6 ,
- .At v10 ,
- .Bx 4.2
- .Sh AUTHORS
- .An Haelwenn (lanodan) Monnier Aq Mt contact+c-u-d@hacktivis.me