GOODDATE(1)
NAME
gooddate - verify date input and convert to standard format
SYNOPSIS
gooddate [-E] [fmt]
DESCRIPTION
Use gooddate to verify date input given on stdin. Dates are accepted
in many formats and converted to fmt format or YYMMDD format if no fmt
is specified. The converted date is output to stdout.
OPTIONS
[-E] This option turns on European date format conversion for input
formats. This can also be turned on by setting the environment
variable DDTS_DATE_FORMAT to European. The default is non-
european date format.
[fmt] Output format for the date. Formats strings are expected to be
enclosed in quotes and follow the format used by strftime(3).
If no format is specified, the ClearDDTS date format YYMMDD is
used. This format represents the last two digits of the year
(1970 = 70, 2030 = 30), the number of the month (Feb = 02), and
the date (3rd = 03). This is also the internal format stored in
the ClearDDTS database.
For non-european dates, the following formats are supported:
Input Example
------------------------------------------------------------
m/d/y 8/16/94
m-d-y 8-16-94
m/d 8/16
m-d 8-16
For European dates, the following formats are supported:
Input Example
------------------------------------------------------------
d/m/y 16/8/94
d-m-y 16-8-94
d/m 16/8
d-m 16-8
For either style, the following formats are also supported:
Input Example
------------------------------------------------------------
day mon d HH:MM:SS TZ YYYY Tue Aug 16 11:15:43 PST 1994
day mon d HH:MM:SS YYYY Tue Aug 16 11:15:43 1994
mon d HH:MM:SS TZ YYYY Aug 16 11:15:43 PST 1994
mon d HH:MM:SS YYYY Aug 16 11:15:43 1994
d-mon-y 16-Aug-94
YYYYMMDD 19940816
YYMMDD 940816
All dates in the above examples would be converted to 940816
if no fmt was specified.
Additionally, ClearDDTS understands the following keywords:
Input Does this
------------------------------------------------------------
asap Today's date
now Today's date
today Today's date
tomorrow Tomorrow's date
yesterday Yesterday's date
mon Next Monday
tue Next Tuesday
wed Next Wednesday
thu Next Thursday
fri Next Friday
sat Next Saturday
sun Next Sunday
DIAGNOSTICS
It works as all standard filters used in the master.tmpl files. It
reads the date from stdin and writes the converted date to stdout. If
the date cannot be converted successfully, an error message is sent to
stderr and the program exits with an exit status of 1. Otherwise it
exits with an exit status of 0.
CAVEATS
The conversion specified by fmt depends on the system call
strftime(3). This call does have bugs in processing the string on
several architectures. For example, on SunOS the %y format gives
incorrect output for years after 2000. Sun has a patch available.
HP-UX does not process the formats %k, %l, %EX, and %u correctly.
Your mileage may vary.
SEE ALSO
template(5), strftime(3)