Home | Previous Page | Next Page   IBM Informix ESQL/C Features (ESQL/C) > Using Enhanced ESQL/C Library Functions >

DATETIME-Format Functions

The ESQL/C DATETIME-format functions are as follows:

These functions support extensions to format era-based DATETIME values:

This section describes locale-specific behavior of the ESQL/C DATETIME-format functions. For general information about the ESQL/C DATETIME-format functions, see the IBM Informix: ESQL/C Programmer's Manual.

GL_DATETIME Support

The GL_DATETIME setting can affect results that these ESQL/C DATETIME-format functions generate. The end-user format that GL_DATETIME specifies overrides date and time formats that the client locale defines. For more information, see Precedence for DATETIME End-User Formats.

DBTIME Support

The ESQL/C DATETIME-format functions support the extended era-based date and time format strings for the DBTIME environment variable. When you set DBTIME to an era-based format, these functions can convert between literal DATETIME strings and internal DATETIME values.

Tip:
IBM Informix products support DBTIME for compatibility with earlier products. It is recommended that you use the GL_DATETIME environment variable for new applications.

If you set DBTIME to a era-based DATETIME format (which is specific to a Chinese or Japanese locale), make sure to set the CLIENT_LOCALE environment variable to a locale that supports era-based dates and times.

Extended DATETIME-Format Strings

The following table shows the extended-format strings that the ESQL/C DATETIME-format functions support.

Format Description December 27, 1991 Printed
%y %m %dc1 Taiwanese Ming Guo date 80 12 27
%Y %m %dc1 Taiwanese Ming Guo date 0080 12 27
%y %m %dj1 Japanese era with abbreviated era symbols H03 12 27
%Y %m %dj1 Japanese era with abbreviated era symbols H0003 12 27
%y %m %dj2 Japanese era with full era symbols A1A2B1B203 12 27
%Y %m %dj2 Japanese era with full era symbols A1A2B1B20003 12 27

In addition to the formats in the preceding table, these ESQL/C DATETIME-format functions support the GLS date and time specifiers. For a list of these specifiers, see GL_DATE and GL_DATETIME.

Precedence for DATETIME End-User Formats

The ESQL/C DATETIME-format functions use the following precedence to determine the end-user format of values in DATETIME columns:

  1. The end-user format that DBTIME specifies (if DBTIME is set)
  2. The end-user format that GL_DATETIME specifies (if GL_DATETIME is set)
  3. The date and time end-user formats that the client locale specifies (if CLIENT_LOCALE is set)
  4. The date and time end-user format from the default locale: %iY-%m-%d %H:%M:%S

For more information on the precedence of DBDATE, GL_DATE, and CLIENT_LOCALE, refer to Date and Time Precedence.

Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]