The format parameter of these functions is based on the format patterns available for the
java.text.SimpleDateFormat Java class. In the format parameter, unquoted alphabetic characters from
A to
Z and
a to
z represent the components of the date or time string. You can include non-pattern alphabetic characters in the string by quoting the text with single quotes. To include a single quote, use
’’.
Table 35 describes the alphabetic characters and their associated presentation in a date or time string.
For any format pattern letter that returns a numeric value (for example, w,
h, and
m), the number of letters in the format pattern represents the minimum number of digits. For formatting functions, if the date or time has fewer digits than the number of pattern letters, the output is padded with zeros. For parsing functions, when the date or time has fewer digits than the number of characters in the format pattern, the extra characters are ignored, unless they are needed to determine the boundaries of adjacent fields.
Table 36 illustrates some example date and time format patterns and the resulting string.