Sets the format for timestamps that are retrieved from the database.
Can be set for an individual connection, or for PUBLIC. You must have the SET ANY PUBLIC OPTION system privilege to set this option for PUBLIC or for another user or role. Takes effect immediately.
The format is a string using the following symbols:
|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 (1 = Sunday, 7 = Saturday)|
|DD||Two-digit day of month|
|DDD[d...]||Character short form for day of the week|
|JJJ||Day of the year, from 1 to 366|
|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||AM or PM (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:
Type the symbol in all uppercase to have the format appear in all uppercase. For example, MMM produces JAN.
Type the symbol in all lowercase to have the format appear in all lowercase. For example, mmm produces jan.
Type the symbol in mixed case to have SQL 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.
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:
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.
If the first two digits of the fractional seconds are mixed case (such as Ss or sSssss) then trailing zeros are removed. For example, hh:nn:ss.Sss could produce 12:34:56.1.
If you change the setting for timestamp_format in a way that re-orders the date format, change the date_order option to reflect the same change, and vice versa. See date_order option.
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2013, SAP AG ou société affiliée SAP - SAP Sybase SQL Anywhere 16.0|