ProvideX V8.20 > Language Reference > 2. Directives
63
DAY_FORMAT Directive
           Specify DAY Format
Formats
1. Set Date Format Mask: DAY_FORMAT [new_fmt$]
2. Read Date Format Mask: DAY_FORMAT READ current_fmt$
Where:
String expression containing the format for the variable DAY.
new_fmt$
Optional. Defaults to "MM/DD/YY".
String expression (max 8kb) containing current DAY_FORMAT setting.
current_fmt$
Description
Use the DAY_FORMAT directive to change the format mask for the DAY variable. The
format string contains the new format for the DAY variable. Characters in the format
string control the following:
Insert current day
DD
Insert current month
MM
Insert current year (last two digits only)
YY
Insert four digit year
YYYY
Insert current year using 00-99 for 1900 through 1999, A0-A9 for 2000
AA
through 2009, B0-B9 for 2010 through 2019, etc.
All other characters in the mask are returned as literals in the DAY variable. The
DAY_FORMAT stays in effect until a START directive is executed.
The DAY_FORMAT directive mask can contain the letters AA (e.g., "MM/DD/AA"). The
format AA indicates a packed two-character year field. ProvideX returns $A0$ for
the year 2000, $A1$ for 2001, $B0$ for 2010, etc. up to $Z9$ for the year 2269. This
format assists with conversion issues in legacy applications.
See Also
DAY System Variable, p.555,
DTE( ) Function, p.420,
JUL( ) Function, p.461.
Examples
Example 1:
Example 2:
0010 PRINT DAY
0010 LET X$="01/01/A0"
0020 DAY_FORMAT "YYYY MM/DD" 0020 DAY_FORMAT "MM/DD/AA"
0030 PRINT DAY
0030 PRINT JUL(X$)
->RUN
0040 PRINT DTE(10957:"%Y %Ml %D")
11/15/00
->RUN
2000 11/15
10957
2000 January 1