ASA Database Administration Guide
Database Options
Alphabetical list of options
Sets the format for dates retrieved from the database.
String
Can be set for an individual connection or for the PUBLIC group. Takes effect immediately.
'YYYY-MM-DD'. This corresponds to ISO date format specifications.
The format is a string using the following symbols:
Symbol | Description |
---|---|
yy | Two digit year |
yyyy | Four digit year |
mm | Two digit month, or two digit minutes if following a colon (as in hh:mm) |
mmm[m...] | Character short form for months—as many characters as there are "m"s |
d | Single digit day of week, (0 = Sunday, 6 = Saturday) |
dd | Two digit day of month |
ddd[d...] | Character short form for day of the week |
hh | Two digit hours |
nn | Two digit minutes |
ss[.ss..] | Seconds and parts of a second |
aa | AM or PM (12 hour clock) |
pp | PM if needed (12 hour clock) |
jjj | Day of the year, from 1 to 366 |
Each symbol is substituted with the appropriate data for the date that is being formatted.
For symbols that represent character data (such as mmm
), you can control the case of the output as follows:
Type the symbol in all upper case to have the format appear in all upper case. For example, MMM
produces JAN
.
Type the symbol in all lower case to have the format appear in all lower case. For example, mmm
produces jan
.
Type the symbol in mixed case to have Adaptive Server Anywhere choose the appropriate case for the language that is being used. For example, in English, typing Mmm
produces May
, while in French it produces mai
.
For symbols that represent numeric data, you can control zero-padding with the case of the symbols:
Type the symbol in same-case (such as MM
or mm
) to allow zero padding. For example, yyyy/mm/dd
could produce 2002/01/01
.
Type the symbol in mixed case (such as Mm
) to suppress zero padding. For example, yyyy/Mm/Dd
could produce 2002/1/1
.
The following table illustrates DATE_FORMAT settings, together with the output from the following statement, executed on Thursday May 21, 2001.
SELECT CURRENT DATE
DATE_FORMAT | SELECT CURRENT DATE |
---|---|
yyyy/mm/dd/ddd | 2001/05/21/thu |
jjj | 141 |
mmm yyyy | May 1998 |
mm-yyyy | 05-1998 |