Purpose

Sets the Informix DBDate server option for formatting literal date values when inserting, updating, and retrieving data in DATE columns. Using this property, you can customize the following items:

  • Order in which the month, day, and year fields appear in a date string
  • Year field to contain two or four digits
  • Separator character used to separate the date fields

This property does not affect the format of the string in the date escape syntax. Dates specified using the date escape syntax always use the JDBC escape format: yyyy-mm-dd.

Valid Values

DMY2[sep_character]  | DMY4[sep_character]  | 
MDY2[sep_character]  | MDY4[sep_character]  | 
Y4DM[sep_character]  | Y4MD[sep_character]  |
Y2DM[sep_character] 

where:

D
is a 2-digit day field.
M
is a 2-digit month field.
Y2
is a 2-digit year field.
Y4
is a 4-digit year field.
sep_character
is one of the following characters used to separate the fields: hyphen (-), period (.), or forward slash (/). If a separator is not specified, a forward slash (/) is used to separate the fields.

If unspecified, the format of literal date values conforms to the default server behavior.

Example

A value of Y4MD- specifies a date format that has a 4-digit year, followed by the month and then by the day. The date fields are separated by a hyphen (-) (for example: 2004-02-15).

Data Source Methods

public String getDBDate()

public void setDBDate(String)

Default

No default value

Data Type

String