Sets the format for timestamps that are retrieved from the database.
UltraLite employs different methods for setting this property:
Context | Implemented by |
---|---|
From the command line Use any utility that creates a database. |
Use the following property syntax: -o timestamp_format=value |
From Sybase Central Use any wizard that creates a database. |
On the New Database Options page, set the Timestamp Format option . |
From a client application Use the create database method. |
Set this property as one of the creation parameters for an API's create database method on the database manager class. |
A string using any of 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. An uppercase M causes the output to be made uppercase. |
d |
Single digit day of week, (0 = Sunday, 6 = Saturday). |
dd |
Two digit day of month. A leading zero is not required. |
ddd[d...] |
Character short form for day of the week. An uppercase D causes the output to be made uppercase. |
hh |
Two digit hours. A leading zero is not required. |
nn |
Two digit minutes. A leading zero is not required. |
ss[.ss..] |
Seconds and parts of a second. |
aa |
Use 12 hour clock. Indicate times before noon with AM. |
pp |
Use 12 hour clock. Indicate times after noon with PM. |
jjj |
Day of the year, from 1 to 366. |
YYYY-MM-DD HH:NN:SS.SSS
You cannot change the timestamp format of an existing database. Instead, you must create a new database.
Allowed values are constructed from the symbols listed in the table above. Each symbol is substituted with the appropriate data for the date that is being formatted.
For the character short forms, the number of letters specified is counted, and then the A.M. or P.M. indicator (which could be localized) is truncated, if necessary, to the number of bytes corresponding to the number of characters specified.
Controlling output case 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 UltraLite 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.
Controlling zero-padding 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 a transaction was executed on Friday May 12, 2006 at 3:30 PM and you used the default timestamp_format syntax of YYYY-MM-DD HH:NN:SS.SSS, the result would be:
2006-05-12 15:30:55.0