Home | Previous Page | Next Page   Data Manipulation > Using Date and Time Data Types > Date-Time or Interval Data >

Date-Time or Interval Text Representation

The text representation of a date-time or interval value is a quoted string that contains a series of digits and symbols. The DataBlade API supports a text representation for date-time or interval values as quoted strings with the formats that the following table shows.

SQL Data Type
Text Representation
DATETIME
Date-time string:

The date-time string must match the qualifier of the DATETIME column. The default format of the date-time string for the largest DATETIME column is:

"yyyy-mm-dd HH:MM:SS.FFFF"

INTERVAL
Interval string:

The interval string must match the qualifiers of the INTERVAL column. INTERVAL columns have two classes. The default format of an interval string for the largest year-month interval follows:

"yyyy-mm"

The default format of an interval string for the largest day-time interval follows:

"dd HH:SS.FFFF"

The text representations in the preceding table use the following abbreviations:

yyyy
is the 4-digit year (for a DATETIME) or the number of years (for an INTERVAL).
mm
is the 2-digit month (for a DATETIME) or the number of months (for an INTERVAL).
dd
is the 2-digit day of the month (for a DATETIME) or the number of days (for an INTERVAL).
HH
is the 2-digit hour (for a DATETIME) or the number of hours (for an INTERVAL).
MM
is the 2-digit minute (for a DATETIME) or the number of minutes (for an INTERVAL).
SS
is the 2-digit second (for a DATETIME) or the number of seconds (for an INTERVAL).
FFFF
is a fraction of a second (for a DATETIME) or the number of years (for an INTERVAL). Fractions can be from 1 to 5 digits.

A date-time value in its text representation is often called a date-time string. For example, the following date-time string contains the value for 2 p.m. on July 12, 1999, with a qualifier of year to minute:

"1999-07-12 14:00:00"

Usually, a date-time string must match the qualifier of the date-time binary representation with which the string is associated.

The following interval string indicates a passage of three years and three months:

"03-06"
Global Language Support

A locale defines the end-user format of a date or time or interval value. The end-user format is the format in which data appears in a client application when the data is a literal string or character variable. The preceding strings are the end-user formats for the default locale, U.S. English. A nondefault locale can define date or time end-user formats that are particular to a country or culture outside the U.S. You can also customize the end-user format of a date with the GL_DATETIME environment variable. For more information, see the IBM Informix: GLS User's Guide.

End of Global Language Support
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]