Sets the format for timestamps that are retrieved from the database.
For Android smartphones, you can use Connection.setOption(OPTION_TIMESTAMP_FORMAT, value) as an alternative to setting this creation parameter. See Connection.setOption method [UltraLiteJ] and Connection.OPTION_TIME_FORMAT variable [BlackBerry] [UltraLiteJ].
UltraLite creates a timestamp from date and time parts that you set with the date_format and time_format creation parameters. Together, date and time total seven parts (year, month, day, hour, minute, second, and millisecond).
Timestamp values can also be represented by strings. Before it can be retrieved, a timestamp value must be assigned to a string variable.
Typically timestamp columns ensure that data integrity is maintained when synchronizing with a consolidated database. Timestamps help identify when concurrent data updates have occurred among multiple remote databases by tracking the last time that each user synchronized.
Ensure that the consolidated database and the UltraLite remote database maintain timestamps and timestamp increments to the same resolution. By setting the these creation parameters to match that of the consolidated database, you can help avoid spurious inequalities.
The format is a string using the following symbols:
|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.|
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. The A.M. or P.M. indicator (which could be localized) is also truncated, if necessary, to the number of bytes corresponding to the number of characters specified.
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.
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.
From Sybase Central, you can set the timestamp format in any wizard that creates a database. On the New database creation parameters page, click the Timestamp Format option.
From a client application, set this parameter as one of the creation parameters for the create database method on the database manager class.
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:
Discuter à propos de cette page dans DocCommentXchange.
|Copyright © 2012, iAnywhere Solutions, Inc. - SQL Anywhere 12.0.1|