ALLBASE/SQL Reference Manual (36216-90216)

248 Chapter8
Expressions
Date/Time Functions
The Z prefix and Q and D are only allowed for the function TO_CHAR. If YY is used
without CC, the default CC is 19. The following elements are for representing
alphabetic characters:
MONTH Name of month
MON Abbreviated name of month
DAYOFWEEK Name of day
DAY Abbreviated name of day
-/:., Punctuation marks reproduced in value (includes spaces)
"string" Quoted string reproduced in value
Delimiting punctuation marks must be the same in the value parameter and the format
specification parameter.
Capitalization in alphabetic representations follows the capitalization of the
corresponding format element. Elements may be represented in uppercase, lowercase,
or initial caps. Other mixtures of uppercase and lowercase letters result in an error. For
example:
'DAYOFWEEK' —--> MONDAY
'Dayofweek' —--> Monday
'dayofweek' —--> monday
'dAyOfWeEk' —--> error condition
Time format is used by the TO_TIME function and by the TO_CHAR functions on
TIME expressions. The default format is 'HH:MI:SS'.
Listed here are formats for elements made up of numeric characters:
HH or HH24 Hour of day (00 to 23)
ZHH or ZHH24 HH or HH24 with leading zeroes suppressed (0 to 23) (TO_CHAR only)
HH12 Hour of day (00 to 12)
ZHH12 HH12 with leading zeroes suppressed (0 to 12) (TO_CHAR only)
MI Minute (00 to 59)
ZMI MI with leading zeroes suppressed (0 to 59) (TO_CHAR only)
SS Second (00 to 59)
ZSS SS with leading zeroes suppressed (0 to 59) (TO_CHAR only)
SECONDS Seconds past midnight (00000 to 86399)
ZSECONDS SECONDS with leading zeroes suppressed (0 to 86399) (TO_CHAR
only)
Z is not allowed for the input functions. The following elements are for representing
alphabetic characters:
AM or PM AM/PM indicator (use capital letters)
A.M. or P.M. A.M./P.M. indicator with periods (use capital letters)