DATE(1x) 1x DATE(1x)

This manual page is part of 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.

datedisplay or set the date and time

date [-u] [-d date] [+format]

date [-u] setdate

Use UTC
date
Use date instead of current datetime (aka now). Absent for POSIX, present for NetBSD, FreeBSD, OpenBSD, GNU coreutils, BusyBox.

It is mostly similar to strftime(3) but it actually presents some differencies, for example POSIX doesn't put the usual ( NetBSD, FreeBSD, OpenBSD, GNU coreutils, BusyBox) %s for seconds since 1970-01-01 00:00:00 UTC (aka Unix Epoch) into date(1) but it is present into strftime(3). Not sure if this is a bug into the specification or not.

NetBSD, FreeBSD, OpenBSD just gives format to strftime(3).

The heck they managed to put in their manpage, followed by strftime(3) format with reusing option formatting.

POSIX
mmddhhmm[cc[yy]] which makes it %m%d%H%M[%C[%y]]
NetBSD, FreeBSD, OpenBSD
[[[[[CC]yy]mm]dd]HH]MM[.SS] which makes it [[[[[%C]%y]%m]%d]%H]%M[.%S]
GNU
MMDDhhmm[CC[YY]][.ss] which makes it %m%d%H%M[%C[%y]][.%S]
BusyBox
Recognized formats:
  • hh:mm[:ss]
  • [YYYY.]MM.DD-hh:mm[:ss]
  • YYYY-MM-DD hh:mm[:ss]
  • [[[[[YY]YY]MM]DD]hh]mm[.ss]
Version 6 AT&T UNIX
mmddhhmm[yy] which makes it %m%d%H%M[%y]
AT&T UNIX v10, 4.2BSD
yymmddhhmm[.ss] which makes it %y%m%d%H%M[.%S]

NetBSD 8.0, FreeBSD 12.0, OpenBSD 6.4, GNU coreutils 8.30, BusyBox 1.30.1, Version 6 AT&T UNIX, AT&T UNIX v10, 4.2BSD

Haelwenn (lanodan) Monnier <contact+c-u-d@hacktivis.me>

2019-03-03 Linux 6.12.21-gentoo-x86_64