Date Templates
The default date template in the US is MM/DD/YYYY. If you are in a different
culture and you have used MODE COUNTRY in either
a CONFIG file or in your APPLICATION
procedure to establish that fact, then the default date form will be in your
country's standard form. This is true everywhere in our documentation where we
assert that the default date form is MM/DD/YYYY. In the following discussion we
are going to assume the US default and you can make any transliterations
yourself.
In every command where a date fieldname is used (that is, a fieldname defined
in the data base as a DATE data type) a template can follow it. The template,
when used as a format override, is always enclosed in quotes and surrounded by
parenthesis, e.g., ("YYYYMMDD").
Depending on the command you are either specifying the form of the date in the
field so we input it or interpret it correctly, or you are specifying how you
want the date delivered to your Procedure or Report.
If all of your dates are always in the default form you never need to use the
template.
Template Definitions
We begin with the following template character definitions:
M
- Numeric Month
X
- Alpha Month
D
- Numeric Day
Z
- Alpha Day
Y
- Year
L
- Last Day of Month
For purposes of discussion lets pick the date as September 2, 1938 (guess who's
birthday that is). We will use that date in all of the examples below.
The template MM/DD/YYYY specifies the date form as 09/02/1938 but you don't
need that one, as it is the default.
YYYYMMDD
specifies
the form 19380902
YYYY.MM.DD
specifies
the form 1938.09.02
YYYY/MM/DD specifies
the form 1938/09/02
YYYY-MM-DD
specifies
the form 1938-09-02
DD/MM/YY
is
02/09/38 but you should not use two-character years
YYMMDD
specifies
380902 but you should not be using two-char years
XXX
DD, YYYY specifies
Sep 02, 1938
ZZZ
XX DD specifies
FRI SEP 02
ZZZZZZZZZ
XXXXXXXXX DD, YYYY specifies Friday September 02, 1938
DD
specifies
02
ZZZZZZZZZ
specifies
Friday (use 9 chars to get longest day spelling)
XXXXXXXXX
specifies
September (9 chars to get longest month spelling)
YYYY
specifies
1938
MM/LL/YYYY
specifies
09/30/1938 (last day of month)
Z
specifies
F
Y
specifies
8
You probably have the picture by now. For information about converting Julian
dates to calendar dates see the SET command description.
Copyright © 2019 , WhamTech, Inc. All rights reserved. This
document is provided for information purposes only and the contents hereof are
subject to change without notice. Names may be
trademarks of their respective owners.