The DBTIME environment variable specifies a formatting mask for the display and data-entry format of DATETIME values.
.---------------------------------------------------. V | >>-setenv--DBTIME--'----+-literal---------------------------------------+-+--'->< '-%--+----+--+-----+--+--------------+--special-' +- --+ '-min-' '-.--precision-' '-0--'
These terms and symbols are described in the pages that follow.
This quoted string can include literal characters as well as placeholders for the values of individual time units and other elements of a DATETIME value. DBTIME takes effect only when you call certain IBM Informix ESQL/C DATETIME routines. (For details, see the IBM Informix: ESQL/C Programmer's Manual.) If DBTIME is not set, the behavior of these routines is undefined, and "YYYY-MM-DD hh:mm:ss.fffff" is the default display and input format for DATETIME YEAR TO FRACTION(5) literal values in the default locale.
The percentage ( % ) symbol gives special significance to the special placeholder symbol that follows. Without a preceding % symbol, any character within the formatting mask is interpreted as a literal character, even if it is the same character as one of the placeholder characters in the following list. Note also that the special placeholder symbols are case sensitive.
The following characters within a DBTIME format string are placeholders for time units (or for other features) within a DATETIME value.
For example, consider this display format for DATETIME YEAR TO SECOND:
Mar 21, 2001 at 16 h 30 m 28 s
If the user enters a two-digit year value, this value is expanded to 4 digits according to the DBCENTURY environment variable setting. If DBCENTURY is not set, then the string 19 is used by default for the first two digits.
Set DBTIME as the following command line (for the C shell) shows:
setenv DBTIME '%b %d, %Y at %H h %M m %S s'
The default DBTIME produces the following ANSI SQL string format:
2001-03-21 16:30:28
You can set the default DBTIME as the following example shows:
setenv DBTIME '%Y-%m-%d %H:%M:%S'
An optional field width and precision specification (w.p) can immediately follow the percent (%) character. It is interpreted as follows:
The following limitations apply to field-width and precision specifications:
The F placeholder does not support this field-width and precision syntax.
Like DBDATE, GL_DATE, or GL_DATETIME, the DBTIME setting controls only the character-string representation of data values; it cannot change the internal storage format of the DATETIME column. (For information about formatting DATE values, see the discussion of DBDATE on page DBDATE.)
In East Asian locales that support era-based dates, DBTIME can also specify Japanese or Taiwanese eras. See IBM Informix: GLS User's Guide for details of additional placeholder symbols for setting DBTIME to display era-based DATETIME values, and for descriptions of the GL_DATETIME and GL_DATE environment variables.
Home | [ Top of Page | Previous Page | Next Page | Contents | Index ]