INFORMIX
Informix Guide to GLS Functionality
Chapter 1: GLS Fundamentals
Home Contents Index Master Index New Book

How Do You Customize Client End-User Formats?

You can set environment variables to override the following end-user formats in the client locale:

This section explains how to customize these end-user formats. For a description of an end-user format, see page 1-12.

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-95 for the date 10/27/95) 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. For more information, see "End-User Formats".

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). For the complete syntax of the GL_DATE and GL_DATETIME environment variables, see the entries for these environment variables in "GLS-Related Environment Variables".

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. For more information about these era-based date formats, see "Date and Time Formats".

Tip: The DBDATE and DBTIME environment variables also provide some support for era-based dates. See the entries for these environment variables in Chapter 2, "GLS Environment Variables."
To specify era-based formats for DATE and DATETIME values, use the E conversion modifier, as follows:

Date and Time Precedence

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

    1. DBDATE

    2. GL_DATE

    3. Information that the client locale defines (CLIENT_LOCALE, if it is set)

    NLS
    4. LC_TIME (if DBNLS is set)

    5. LANG (if DBNLS is set, and LC_TIME is not set)

    If LANG is set, but LC_TIME is not, the client application sets LC_TIME from the LANG value; it does not send LANG to the database server.

    6. Default date format = %m/%d/%iy (if DBDATE, GL_DATE and DBNLS are not set, and no locale is specified)

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)

    NLS
    4. LC_TIME (if DBNLS is set)

    If LANG is set, but LC_TIME is not, the client application sets LC_TIME from the LANG value; it does not send LANG to the database server.

    5. LANG (if DBNLS is set, but LC_TIME is not set)

    6. Default DATETIME format = %iY-%m-%d %H:%M:%S (if CLIENT_LOCALE, DBTIME, GL_DATETIME, and DBNLS are not set)

Customizing Monetary Values

The GLS locales contain end-user formats, which you do not usually need to change. However, you can set the DBMONEY environment variable to customize the appearance of the currency notation. For information on the DBMONEY environment variable, see Chapter 4 of the Informix Guide to SQL: Reference.

A monetary end-user format string specifies a format for the manipulation of internal DECIMAL, FLOAT, and MONEY values as monetary literal strings. For more information, see "End-User Formats". Informix products use the following precedence to determine the end-user format for a MONEY value:

    1. DBMONEY

    2. Information that the client locale defines (CLIENT_LOCALE, identifies the client locale; if it and DBNLS are not set, then the client locale is the default locale)

    NLS
    3. LC_MONETARY (if DBNLS is set)

    4. LANG (if DBNLS is set, but LC_MONETARY is not set)

    If LANG is set, but LC_MONETARY is not, the client application sets LC_MONETARY from the LANG value; it does not send LANG to the database server.

    5. Default currency notation = $,.

    If DBMONEY and DBNLS are not set, and no locale is specified, the currency symbol is the dollar sign, the thousands separator is a comma, and the decimal separator is the period.




Informix Guide to GLS Functionality, version 9.1
Copyright © 1998, Informix Software, Inc. All rights reserved.