Home | Previous Page | Next Page   GLS Fundamentals > Customizing End-User Formats >

Customizing Date and Time End-User Formats

The GLS locales define end-user formats for dates and times, which you do not usually need to change. However, you can customize end-user formats for DATE and DATETIME values (for example, 10-27-97 for the date 10/27/97) with the following environment variables.

Environment Variable Description
GL_DATE Supports extended format strings for international formats in date end-user formats.
GL_DATETIME Supports extended format strings for international formats in time end-user formats.
DBDATE Specifies a date end-user format. (Supported for backward compatibility.)
DBTIME Specifies a time end-user format for certain embedded-language (ESQL) library functions. (Supported for backward compatibility.)

A date or time end-user format string specifies a format for the manipulation of internal DATE or DATETIME values as a literal string.

Tip:
When you set these environment variables, you do not affect the internal format of the DATE and DATETIME values within a database.

The GL_DATE and GL_DATETIME environment variables support formatting directives that allow you to specify an end-user format. A formatting directive has the form %x (where x is one or more conversion characters).

Era-Based Date and Time Formats

The GL_DATE and GL_DATETIME environment variables provide support for alternative dates and times such as era-based (Asian) formats. These alternative formats support dates such as the Taiwanese Ming Guo year and the Japanese Imperial-era dates.

Tip:
DBDATE and DBTIME can also provide some support for era-based dates.

To specify era-based formats for DATE and DATETIME values, use the E conversion modifier, as follows:

Date and Time Precedence

IBM Informix products use the following precedence to determine the end-user format for an internal DATE value:

  1. DBDATE
  2. GL_DATE
  3. Information defined in the client locale (if CLIENT_LOCALE is set)
  4. Default date format is %m/%d/%iy (if DBDATE and GL_DATE are not set, and no locale is specified)

IBM Informix products use the following precedence to determine the end-user format for an internal DATETIME value:

  1. DBDATE and DBTIME
  2. GL_DATETIME
  3. Information that the client locale defines (CLIENT_LOCALE, if it is set)
  4. Default DATETIME format is %iY-%m-%d %H:%M:%S (if CLIENT_LOCALE, DBTIME and GL_DATETIME are not set)

For more information on these formatting directives, see GL_DATE and GL_DATETIME.

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