Format date strings
A date-formatting mask specifies a format to apply to some date value.
- dd
- Day of the month as a two-digit number (01 - 31)
- ddd
- Day of the week as a three-letter abbreviation (Sun - Sat)
- mm
- Month as a two-digit number (01 - 12)
- mmm
- Month as a three-letter abbreviation (Jan - Dec)
- yy
- Year as a two-digit number (00 - 99)
- yyyy
- Year as a four-digit number (0001 - 9999)
- ww
- Day of the week as a two-digit number (00 for Sunday, 01 for Monday, 02 for Tuesday ...; 06 for Saturday)
Any other characters in the formatting mask are reproduced literally in the result.
When you use a nondefault locale whose dates contain eras, you can use extended-format strings in a numeric-formatting mask.
When you
use rfmtdate() or rdefmtdate() to
format DATE values, the function uses the date end-user formats that
the GLDATE or DBDATE environment
variable specifies. If neither of these environment variables is set,
these date-formatting functions use the date end-user formats for
the locale. The default locale, U.S. English, uses the format mm/dd/yyyy
.
For a discussion of GLDATE and DBDATE environment
variables, see the HCL OneDB™ GLS
User's Guide.