INFORMIX
Informix-ESQL/C Programmer's Manual
Chapter 6: Working with Time Data Types
Home Contents Index Master Index New Book

The SQL DATE Data Type

ESQL/C supports the SQL DATE data type with the ESQL/C date data type for host variables. The date data type stores internal DATE values. It is implemented as a long integer, a four-byte integer whose value is the number of days since December 31, 1899. Dates before December 31, 1899, are negative numbers, while dates after December 31, 1899, are positive numbers. For a complete description of the SQL DATE data type, see the Informix Guide to SQL: Reference.

Formatting Date Strings

A date-formatting mask specifies a format to apply to some date value. This mask is a combination of the following formats.

Format Meaning

dd

Day of the month as a two-digit number (01 through 31)

ddd

Day of the week as a three-letter abbreviation (Sun through Sat)

mm

Month as a two-digit number (01 through 12)

mmm

Month as a three-letter abbreviation (Jan through Dec)

yy

Year as a two-digit number in the 1900s (00 through 99)

yyyy

Year as a four-digit number (0001 through 9999)

Any other characters in the formatting mask are reproduced literally in the result.

GLS
When you use a nondefault locale whose dates contain eras, you can use extended-format strings in a numeric-formatting mask. For more information, see the
Informix Guide to GLS Functionality.

When you use rfmtdate or rdefmtdate() to format DATE values, the function uses the date end-user formats that the GL_DATE or DBDATE environment variable specifies. If neither of these environment variables is set, these date-formatting functions use the date end-user formats for the locale. The default locale, U.S. English, uses the format mm/dd/yyyy. For a discussion of GL_DATE and DBDATE, see the Informix Guide to GLS Functionality.




Informix-ESQL/C Programmer's Manual, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.