Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - Database Administration » Database Options » Introduction to database options » Alphabetical list of options

time_zone_adjustment option [database] Next Page

timestamp_format option [compatibility]


Sets the format for timestamps that are retrieved from the database.

Allowed values

String (composed of the symbols listed below)

Default

YYYY-MM-DD HH:NN:SS.SSS

For Open Client and JDBC connections the default is set to YYYY-MM-DD HH:NN:SS.SSS

Scope

Can be set for an individual connection or for the PUBLIC group. Takes effect immediately.

Remarks

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
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.ssssss Seconds and fractions of a second, up to six decimal places. Not all platforms support timestamps to a precision of six places.
AA A.M. or P.M. (12 hour clock)—omit AA and PP for 24 hour time
PP PM if needed (12 hour clock)—omit AA and PP for 24 hour time

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:

If the character data is multibyte, the length of each symbol reflects the number of characters, not the number of bytes. For example, the 'mmm' symbol specifies a length of three characters for the month.

For symbols that represent numeric data, you can control zero-padding with the case of the symbols:

See also