History log of /src/bin/date/date.1
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: perseant-exfatfs-base-20250801 netbsd-11-base
# 1.57 17-Sep-2024 kre

date(1) says:

STANDARDS
The date utility is expected to be compatible with IEEE Std 1003.2
(“POSIX.2”).

yet the format used for the date string arg is:

[[[[[[CC]yy]mm]dd]HH]MM[.SS]]

whereas POSIX demands

mmddHHMM[[CC]yy]

Why anyone would ever want to use that archaic form is incomprehensible
to me, yet, that is what is required.

Implement support for the POSIX format if POSIXLY_CORRECT is set in
the environment (in the full date(1) build only) in a rather crude
way that relies upon the user getting the format correct.

Tools builds are unaffected - setting the time is not supported there.
(It could be made to work, half setting the time, using -j, is possible
in tools builds, but pointless, and this cheap implementation uses
strptime() which is not necessarily available to a tools build.)

Mention this (very briefly) in the man page.


# 1.56 17-Sep-2024 kre

Add -U and -z options to date(1).

-U allows the (internal) TZ setting to be returned
to what it was when date started running.

-z zone sets TZ to be "zone" unless that is an empty
string, in which case it causes TZ to be removed from
the environment.

These can be used together to manipulate TZ around
parsing of a -d arg, to allow its parsing to be done
in a different zone than the one used for output, and
all unrelated to the initial TZ setting (or system default).

Note that these new options only appear in the first
synopsis form in both the man page and usage(), as -d
also appears only there, and these options make little
sense without also using -d.

This is a very simple change which amounts to no more
that a few setenv() and unsetenv() calls.


# 1.55 17-Sep-2024 kre

Note that the order in which the -u and -d options are given matters.


Revision tags: perseant-exfatfs-base-20240630 perseant-exfatfs-base
# 1.54 31-May-2023 uwe

branches: 1.54.2;
date(1): sync two [[[[[CC]yy]mm]dd]HH]MM[.SS] instances

The markup was the same (modulo Li vs Cm for the dot before the
seconds), but use the same source markup grouping/layout in both to
make this fact more obvious.


# 1.53 31-May-2023 uwe

date(1): minor markup fixes


# 1.52 31-May-2023 kim

Add -R option for displaying time in RFC 5322 format, similar to GNU date.


Revision tags: netbsd-10-base
# 1.51 22-Oct-2022 christos

branches: 1.51.2;
Add -f option to set the time. From FreeBSD.


# 1.50 10-May-2022 uwe

date(1): Use .Dl for one-liners. Same output is generated.


# 1.49 10-May-2022 uwe

date(1): Fix the offset in previous.


# 1.48 10-May-2022 wiz

date(1): add example for how to get seconds since the Epoch output


Revision tags: netbsd-9-3-RELEASE cjep_sun2x-base1 cjep_sun2x-base cjep_staticlib_x-base1 netbsd-9-2-RELEASE cjep_staticlib_x-base netbsd-9-1-RELEASE phil-wifi-20200421 phil-wifi-20200411 is-mlppp-base phil-wifi-20200406 netbsd-9-0-RELEASE netbsd-9-0-RC2 netbsd-9-0-RC1 phil-wifi-20191119 netbsd-9-base phil-wifi-20190609 pgoyette-compat-merge-20190127 pgoyette-compat-20190127 pgoyette-compat-20190118 pgoyette-compat-1226 pgoyette-compat-1126 pgoyette-compat-1020 pgoyette-compat-0930 pgoyette-compat-0906 pgoyette-compat-0728 phil-wifi-base pgoyette-compat-0625 pgoyette-compat-0521 pgoyette-compat-0502 pgoyette-compat-0422 pgoyette-compat-0415 pgoyette-compat-0407 pgoyette-compat-0330 pgoyette-compat-0322 pgoyette-compat-0315 pgoyette-compat-base
# 1.47 27-Jan-2018 wiz

branches: 1.47.4; 1.47.6;
Remove trailing whitespace and Tn macro.


# 1.46 25-Jan-2018 christos

sync with tzcode-2018c


Revision tags: perseant-stdc-iso10646-base
# 1.45 03-Jul-2017 wiz

Remove workaround for ancient HTML generation code.


Revision tags: netbsd-8-3-RELEASE netbsd-8-2-RELEASE netbsd-8-1-RELEASE netbsd-8-1-RC1 netbsd-8-0-RELEASE netbsd-8-0-RC2 netbsd-8-0-RC1 matt-nb8-mediatek-base netbsd-8-base prg-localcount2-base3 prg-localcount2-base2 prg-localcount2-base1 prg-localcount2-base pgoyette-localcount-20170426 bouyer-socketcan-base1 pgoyette-localcount-20170320 bouyer-socketcan-base pgoyette-localcount-20170107
# 1.44 03-Jan-2017 abhinav

The range of the SS field is [0,60]

From the POSIX time.h man page:
"The formal definition of UTC does not permit double leap seconds, so all mention of double leap seconds has been removed, and the range shortened from the former [0,61] seconds seen in previous versions of POSIX."


Revision tags: pgoyette-localcount-20161104 localcount-20160914
# 1.43 11-Aug-2016 sevan

Document the version date first appeared.
Bump date.


Revision tags: netbsd-7-2-RELEASE netbsd-7-1-2-RELEASE netbsd-7-1-1-RELEASE netbsd-7-1-RELEASE netbsd-7-1-RC2 netbsd-7-nhusb-base-20170116 netbsd-7-1-RC1 netbsd-7-0-2-RELEASE netbsd-7-nhusb-base pgoyette-localcount-20160806 pgoyette-localcount-20160726 pgoyette-localcount-base netbsd-7-0-1-RELEASE netbsd-7-0-RELEASE netbsd-7-0-RC3 netbsd-7-0-RC2 netbsd-7-0-RC1 netbsd-7-base yamt-pagecache-base9 tls-earlyentropy-base riastradh-xf86-video-intel-2-7-1-pre-2-21-15 riastradh-drm2-base3 riastradh-drm2-base2 riastradh-drm2-base1 riastradh-drm2-base agc-symver-base yamt-pagecache-base8 yamt-pagecache-base7 yamt-pagecache-base6 tls-maxphys-base yamt-pagecache-base5 yamt-pagecache-base4
# 1.42 06-Apr-2012 wiz

branches: 1.42.16;
- fix timed(8) references;
- fix capitalization;
- add reference to environ(7) in `SEE ALSO' section, as it is
mentioned in the text.

From patch by Bug Hunting.


Revision tags: netbsd-6-0-6-RELEASE netbsd-6-1-5-RELEASE netbsd-6-1-4-RELEASE netbsd-6-0-5-RELEASE netbsd-6-1-3-RELEASE netbsd-6-0-4-RELEASE netbsd-6-1-2-RELEASE netbsd-6-0-3-RELEASE netbsd-6-1-1-RELEASE netbsd-6-0-2-RELEASE netbsd-6-1-RELEASE netbsd-6-1-RC4 netbsd-6-1-RC3 netbsd-6-1-RC2 netbsd-6-1-RC1 netbsd-6-0-1-RELEASE matt-nb6-plus-nbase netbsd-6-0-RELEASE netbsd-6-0-RC2 matt-nb6-plus-base netbsd-6-0-RC1 netbsd-6-base yamt-pagecache-base3 yamt-pagecache-base2 yamt-pagecache-base cherry-xenmp-base bouyer-quota2-nbase bouyer-quota2-base matt-mips64-premerge-20101231
# 1.41 04-Feb-2010 wiz

branches: 1.41.6;
Remove trailing whitespace.


# 1.40 04-Feb-2010 reed

For the -d option, refer to parsedate(3) for examples.


Revision tags: matt-premerge-20091211 jym-xensuspend-nbase jym-xensuspend-base
# 1.39 30-Jan-2009 reed

Show that "seconds" is the expected argument for -r.
(I didn't bump the manual page date for this minor change. If I
should let me know.)


Revision tags: netbsd-5-2-3-RELEASE netbsd-5-1-5-RELEASE netbsd-5-2-2-RELEASE netbsd-5-1-4-RELEASE netbsd-5-2-1-RELEASE netbsd-5-1-3-RELEASE netbsd-5-2-RELEASE netbsd-5-2-RC1 netbsd-5-1-2-RELEASE netbsd-5-1-1-RELEASE matt-nb5-mips64-premerge-20101231 matt-nb5-pq3-base netbsd-5-1-RELEASE netbsd-5-1-RC4 matt-nb5-mips64-k15 netbsd-5-1-RC3 netbsd-5-1-RC2 netbsd-5-1-RC1 netbsd-5-0-2-RELEASE matt-nb5-mips64-premerge-20091211 matt-nb5-mips64-u2-k2-k4-k7-k8-k9 matt-nb4-mips64-k7-u2a-k9b matt-nb5-mips64-u1-k1-k5 netbsd-5-0-1-RELEASE netbsd-5-0-RELEASE netbsd-5-0-RC4 netbsd-5-0-RC3 netbsd-5-0-RC2 netbsd-5-0-RC1 netbsd-5-base matt-mips64-base2 mjf-devfs2-base netbsd-4-0-1-RELEASE wrstuden-revivesa-base-3 wrstuden-revivesa-base-2 wrstuden-fixsa-newbase wrstuden-revivesa-base-1 yamt-pf42-base4 yamt-pf42-base3 hpcarm-cleanup-nbase yamt-pf42-baseX yamt-pf42-base2 wrstuden-revivesa-base yamt-pf42-base keiichi-mipv6-base matt-armv6-nbase matt-armv6-prevmlocking wrstuden-fixsa-base-1 netbsd-4-0-RELEASE cube-autoconf-base netbsd-4-0-RC5 netbsd-4-0-RC4 netbsd-4-0-RC3 netbsd-4-0-RC2 netbsd-4-0-RC1 matt-armv6-base matt-mips64-base hpcarm-cleanup-base wrstuden-fixsa-base netbsd-4-base
# 1.38 26-Nov-2006 wiz

Drop trailing whitespace.


# 1.37 20-Nov-2006 christos

getdate -> parsedate


# 1.36 15-Nov-2006 christos

Add -d option, similar to gnu date.


# 1.35 15-Nov-2006 jdarrow

Add -j flag to not actually change the clock, just parse the date given
(if any) and then display it in the format given. Matches similar -j
flag functionality in FreeBSD/OpenBSD.

Change requested by George Georgalis on netbsd-users.

While I'm here, disambiguate the letters in the date string, by using
the same option letters as used by strftime(3).


Revision tags: abandoned-netbsd-4-base
# 1.34 18-Apr-2005 dsl

Add a '-a' option to set the time using adjtime(2) instead of settimeofday(2).
Fix usage so that the options which apply to dat/time setting are on the
correct line.


Revision tags: netbsd-3-1-1-RELEASE netbsd-3-0-3-RELEASE netbsd-3-1-RELEASE netbsd-3-0-2-RELEASE netbsd-3-1-RC4 netbsd-3-1-RC3 netbsd-3-1-RC2 netbsd-3-1-RC1 netbsd-3-0-1-RELEASE netbsd-3-0-RELEASE netbsd-3-0-RC6 netbsd-3-0-RC5 netbsd-3-0-RC4 netbsd-3-0-RC3 netbsd-3-0-RC2 netbsd-3-0-RC1 netbsd-2-0-3-RELEASE netbsd-2-1-RELEASE netbsd-2-1-RC6 netbsd-2-1-RC5 netbsd-2-1-RC4 netbsd-2-1-RC3 netbsd-2-1-RC2 netbsd-2-1-RC1 netbsd-2-0-2-RELEASE netbsd-3-base netbsd-2-0-1-RELEASE netbsd-2-base netbsd-2-0-RELEASE netbsd-2-0-RC5 netbsd-2-0-RC4 netbsd-2-0-RC3 netbsd-2-0-RC2 netbsd-2-0-RC1 netbsd-2-0-base
# 1.33 07-Aug-2003 agc

Move UCB-licensed code from 4-clause to 3-clause licence.

Patches provided by Joel Baker in PR 22249, verified by myself.


# 1.32 25-Feb-2003 wiz

.Nm does not need a dummy argument ("") before punctuation or
for correct formatting of the SYNOPSIS any longer.


Revision tags: fvdl_fs64_base
# 1.31 25-Sep-2002 wiz

New policy: New sentences start on a new line.
Patches by Robert Elz <kre at munnari oz au>, with minimal changes by me.


Revision tags: netbsd-1-6-PATCH002-RELEASE netbsd-1-6-PATCH002 netbsd-1-6-PATCH002-RC4 netbsd-1-6-PATCH002-RC3 netbsd-1-6-PATCH002-RC2 netbsd-1-6-PATCH002-RC1 netbsd-1-6-PATCH001 netbsd-1-6-PATCH001-RELEASE netbsd-1-6-PATCH001-RC3 netbsd-1-6-PATCH001-RC2 netbsd-1-6-PATCH001-RC1 netbsd-1-6-RELEASE netbsd-1-6-RC3 netbsd-1-6-RC2 netbsd-1-6-RC1 netbsd-1-6-base
# 1.30 08-Feb-2002 ross

Generate <>& symbolically. I'm avoiding .../dist/... directories for now.


# 1.29 20-Dec-2001 wiz

Sort sections.


# 1.28 20-Dec-2001 wiz

Whitespace nits.


# 1.27 09-Mar-2001 hubertf

xref settimeofday(2)


# 1.26 18-Dec-2000 hubertf

Document /etc/localtime, per PR 8099 by Charles Hannum.


# 1.25 08-Oct-2000 bjh21

Formatting cleanup: more fonts, less punctuation.


Revision tags: netbsd-1-5-RELEASE netbsd-1-5-BETA2 netbsd-1-5-BETA netbsd-1-5-ALPHA2 netbsd-1-5-base minoura-xpg4dl-base
# 1.24 29-Dec-1999 hubertf

branches: 1.24.4;
make example cut&paste-ready


Revision tags: wrstuden-devbsize-19991221 wrstuden-devbsize-base comdex-fall-1999-base netbsd-1-4-PATCH001 netbsd-1-4-RELEASE netbsd-1-4-base
# 1.23 09-Mar-1999 ross

branches: 1.23.2;
Work around a spurious warning.


# 1.22 08-Jun-1998 lukem

remove unnecessary comment


# 1.21 20-Jan-1998 mycroft

Make the documented parsing order for the date match reality.


# 1.20 20-Jan-1998 mycroft

Fix documentation of `-r'.


# 1.19 20-Jan-1998 mycroft

Allow a century to be specified.
Cut and paste some text from touch(1) about date parsing.


# 1.18 03-Nov-1997 kleink

s/UCT/UTC/


Revision tags: netbsd-1-3-base
# 1.17 20-Oct-1997 enami

branches: 1.17.2;
Fix .Nm usage.


# 1.16 11-May-1997 mikel

fix broken timed(8) xrefs, noted by David Brownlee.


# 1.15 11-Mar-1997 perry

Add documentation of the fact that date does indeed understand years
after 2000 (years 00 through 68 are interpreted as meaning 2000-2068;
this should be updated sometime before 2068 :-)


# 1.14 25-Jan-1997 perry

nuke the BUGS section -- it was vax specific


# 1.13 24-Jan-1997 perry

remove obsolete -d and -t options -- kernel timezone handling is long gone


Revision tags: netbsd-1-2-PATCH001 netbsd-1-2-RELEASE netbsd-1-2-BETA netbsd-1-2-base
# 1.12 12-Mar-1996 phil

a a => a (close pr 2204).


# 1.11 05-Dec-1995 jtc

ENVIRONMENTAL -> ENVIRONMENT


Revision tags: netbsd-1-1-PATCH001 netbsd-1-1-RELEASE netbsd-1-1-base
# 1.10 07-Sep-1995 jtc

Sync with 4.4lite2


# 1.9 25-Jul-1995 jtc

Use "utility" instead of "command". Modern definitions of these terms
are distinct (See POSIX.2 glossary).

A utility is a executable, script or shell builtin; while a command
can be any of those things plus lists, pipelines, compound commands
(if, for, while) and shell function definitions.


# 1.8 21-Mar-1995 cgd

convert to new RCS id conventions.


# 1.7 22-Sep-1994 mycroft

Merge 4.4-Lite version.


Revision tags: netbsd-1-0-PATCH06 netbsd-1-0-PATCH05 netbsd-1-0-PATCH04 netbsd-1-0-PATCH03 netbsd-1-0-PATCH02 netbsd-1-0-PATCH1 netbsd-1-0-PATCH0 netbsd-1-0-RELEASE netbsd-1-0-base
# 1.6 19-Aug-1993 jtc

Print correct default output format.
Note that date (with a suitable strftime()), is 1003.2 compliant.


# 1.5 16-Aug-1993 jtc

1003.2: 4.15.4: The output always shall be terminated by a newline character.


# 1.4 01-Aug-1993 mycroft

Add RCS indentifiers.


Revision tags: netbsd-0-9-RELEASE netbsd-0-9-BETA netbsd-0-9-ALPHA2 netbsd-0-9-ALPHA netbsd-0-9-base netbsd-0-8 netbsd-alpha-1
# 1.3 23-Mar-1993 cgd

changed "Id" to "Header" for rcsids


# 1.2 22-Mar-1993 cgd

added rcs ids to all files


# 1.1 21-Mar-1993 cgd

branches: 1.1.1;
Initial revision