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

SQL Anywhere 10.0.1 » UltraLite - Database Management and Reference » UltraLite Database Settings Reference » Configurable properties in UltraLite

UltraLite collation property Next Page

UltraLite date_format property


Sets the default string format in which dates are retrieved from the database.

How to set it

UltraLite employs different methods for setting this property:

ContextImplemented by

From the command line    Use any utility that creates a database.

Use the following property syntax:

- o date_format=value

From Sybase Central    Use any wizard that creates a database.

On the New Database Options page, set the Date 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.

Allowed values

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.

Default

YYYY-MM-DD, which corresponds to ISO date format specifications.

Remarks

You cannot change the date 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:

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

Example

The following table illustrates usage options date_format settings, together with the output from a SELECT CURRENT DATE statement, executed on Thursday May 21, 2001.

date_format syntax used

Result returned

yyyy/mm/dd/ddd

2001/05/21/thu

jjj

141

mmm yyyy

may 2001

mm-yyyy

05-2001

See also