src_mbs_bytes
is the integer number of bytes in the buffer of multibyte characters to be case converted.
Yes
>0
The number of bytes required to store multibyte characters of length src_mbs_bytes after they have been converted to either lowercase or uppercase characters.
0
The function was not successful.
ifx_gl_conv_needed() The ifx_gl_conv_needed() function determines whether code-set conversion between two code sets is required. Syntax
dst_codeset
is a pointer to the name of the destination (target) code set.
src_codeset
is a pointer to the name of the source code set.
8859-1
819
Latin-1
Return Values
Code-set conversion is not needed between the code sets that dst_codeset and src_codeset specify.
1
Code-set conversion is needed between the code sets that dst_codeset and src_codeset specify.
-1
The function was not successful, and the error number is set to indicate the cause. See the Errors section.
IFX_GL_EBADF
Function cannot find the code-set registry.
IFX_GL_BADFILEFORM
Bad format found in the code-set registry.
Related Topics See the descriptions of the following functions: ifx_gl_cv_mconv(), ifx_gl_cv_outbuflen(), ifx_gl_cv_sb2sb_table(), and ifx_gl_lc_errno(). For more information, see "Code-Set Conversion".
ifx_gl_convert_date() The ifx_gl_convert_date() function converts a date string to its internal date representation. Syntax
date
is a pointer to the variable that holds the internal date representation that ifx_gl_convert_date() creates from the datestr date string.
datestr
format
is a pointer to the format string that determines how to interpret the datestr date string. For more information, see "Format String".
Format String If format is NULL, the ifx_gl_convert_date() function determines the format of the datestr date string that it scans from the environment, as follows:
1. If the DBDATE environment variable is set, the function scans datestr according to the order of the format elements in DBDATE.
2. If the GL_DATE environment variable is set, the function scans datestr according to the specification of GL_DATE.
3. Otherwise, the function obtains the format from the d_fmt subcategory of the LC_TIME category in the current GLS locale file.
(1 of 2)
One or more white-space characters
The function skips over the corresponding number of white-space characters in the datestr date string (unless the formatting directive begins with the minus-sign modifier), up to the first character that is not white space or until no more characters can be scanned. White-space characters are those that the blank class of the LC_CTYPE category in the current locale defines.
To execute a series of formatting directives composed of %n, %t, white-space characters, or any combination, the function scans up to the first character that is not white space (which remains unscanned) or until no more characters can be scanned.
A valid formatting directive
The function performs the specified conversion on the date element in the datestr date string. It replaces the formatting directive with an internal representation of the date element for conversion to the date value. There must be white-space or other nonalphanumeric characters between any two formatting directives.
Ordinary characters
The function must find the same ordinary character in the datestr date string. Any mismatch generates an error. The differing and subsequent characters in datestr remain unscanned.
You cannot include white-space characters as ordinary characters.
The formatting directive consists of the following sequence:
modifiers
For more information, see "Modified Formatting Directives".
flags
For more information, see "Field Width".
maximum_width
minimum_width
type_specifier
For more information, see "Valid Type Specifiers".
%a
Matches the day of the week. You can specify either the abbreviated or full weekday names, which the abday and day subcategories of LC_TIME define, respectively.
%A
Is the same as %a.
%b
Matches the month. You can specify either the abbreviated or full month names, which the abmon and mon subcategories of LC_TIME define, respectively.
%B
Is the same as %b.
%C
Matches the century number [0,99]. Leading zeros are permitted but not required. If %C is used without %y, it is ignored.
%d
Matches the day of the month as a decimal number [01,31]. Leading zeros are permitted but not required.
%e
Is the same as %d.
%h
%j
Matches the day of the year as a decimal number [001,366]. Leading zeros are permitted but not required.
%m
Matches the month as a decimal number [01,12]. Leading zeros are permitted but not required.
%n
Matches any horizontal white space that the blank class of the LC_CTYPE category defines.
%t
Matches any vertical white space that the space class of the LC_CTYPE category defines.
%u
Matches the weekday as a decimal number [1,7], with 0 representing Sunday. Leading zeros are permitted but not required.
%w
Matches the weekday as a decimal number [0,6], with 0 representing Sunday. Leading zeros are permitted but not required.
%x
Indicates use of the format that the d_fmt subcategory of LC_TIME defines.
%y
Matches the year within century as a decimal number [00,99]. Leading zeros are permitted but not required. If %y is used without %C and the month and day of month are part of the datestr string, the function determines the century from the DBCENTURY environment variable.
%Y
Matches the year, including the century, as a decimal number [0000,9999].
%%
Matches the % symbol.
E
Use formats that include the era-based dates.
era, era_d_fmt
O
Use alternative locale-specific digits in dates.
alt_digits
The alternative format replaces one that an unmodified formatting directive normally uses. If the alternative format does not exist for the current locale, the behavior is the same as if unmodified formatting directives were used. The ifx_gl_convert_date() function supports the following modified formatting directives with the E and O modifier.
%EC
Matches the name of the base year (period) in the alternative representation. You can specify either the abbreviated or full name, which the era subcategory of LC_TIME defines.
%Eg
Is the same as %EC.
%Ex
Indicates use of the format that the era_d_fmt subcategory of LC_TIME category defines.
%Ey
Matches the offset from %EC (year only) in the alternative representation, which the era subcategory of LC_TIME defines.
%EY
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the full alternative year representation, which the era subcategory of LC_TIME defines.
%Od
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the day of the month. Leading zeros are permitted but not required.
%Oe
Is the same as %Od.
%Om
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the month.
%Ow
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the weekday as a number (Sunday=0).
%Oy
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the value of %Ey.
The ifx_gl_convert_date() function needs the era base, era offset, day, and month to determine the year from era information. The function uses a default era offset of 1 if you specify era base, day, and month but not era offset. The ifx_gl_convert_date() function also supports the i modifier in the following formatting directives to support formats that are backward compatible with earlier Informix date and time formatting.
i
%iy
Indicates use of the Informix DBDATE format Y2. Both 98 and 1998 are interpreted as 1998 (or whichever century is appropriate according to DBCENTURY).
98
1998
%iY
Indicates use of the Informix DBDATE format Y4. Both 98 and 1998 are interpreted as 1998 (or whichever century is appropriate according to DBCENTURY).
Field Width You can modify some formatting directives with the following modifiers to indicate use of an alternative format that the LC_TIME locale-file category of the current locale might define:
[ - | 0 ]
indicates field justification.
If the specification begins with a minus sign (-), the function assumes that the field is left justified. In this case, the value that is being read must start with a digit and can be trailed with spaces. The field can be preceded with leading spaces unless the first character is a zero. If the specification begins with a zero (0), the function assumes that the field is right justified. Any padding to the left must use zeros. Otherwise, the function assumes that the datestr string is right justified.
maximum-width
is a decimal number that indicates an optional maximum field width.
minimum-width
indicates an optional minimum field width. The minimum field width has the format of a period (.) followed by a decimal number. The minimum_width decimal number represents the minimum number of characters to read. If the function reads fewer than minimum_width characters, it generates an error (unless you specified left justification). When you specify left justification, the function skips any trailing white space to read the required number of characters.
The function was successful.
A formatting directive is invalid.
IFX_GL_INVALIDFMT
The format string is invalid.
IFX_GL_EDAYRANGE
Day number is out of bounds.
IFX_GL_EWKDAYRANGE
Weekday number is out of bounds.
IFX_GL_EYDAYRANGE
Year day number is out of bounds.
IFX_GL_EMONTHRANGE
Month number is out of bounds.
IFX_GL_EYEARRANGE
Year number is out of bounds.
IFX_GL_EERAOFFRANGE
Era offset is out of bounds.
IFX_GL_BADDAY
Month (as a number) could not be scanned.
IFX_GL_BADWKDAY
Weekday (as a number) could not be scanned.
IFX_GL_BADYDAY
Day of year (as a number) could not be scanned.
IFX_GL_BADMONTH
Month could not be scanned.
IFX_GL_BADYEAR
Year could not be scanned.
IFX_GL_BADERANAME
Invalid era name.
IFX_GL_BADERAOFFSET
Invalid era offset.
IFX_GL_BADFMTMOD
Invalid format modifier.
IFX_GL_BADFMTWP
Invalid width.
IFX_GL_BADINPUT
Input string does not match format string.
IFX_GL_NOPOINT
Missing decimal point in input string.
IFX_GL_BADMONTHSTR
Month string could not be scanned.
IFX_GL_BADERASPEC
Could not load era from locale.
Related Topics See the descriptions of the following functions: ifx_gl_convert_datetime(), ifx_gl_format_date(), and ifx_gl_lc_errno(). ifx_gl_convert_datetime() The ifx_gl_convert_datetime() function converts a date/time string to its internal date/time representation. Syntax
datetime
is a pointer to the variable that holds the internal date/time representation that ifx_gl_convert_datetime() creates from the datetimestr date/time string.
datetimestr
is a pointer to the format string that determines how to interpret the datetimestr date/time string. For more information, see "Format String".
Format String If format is NULL, the ifx_gl_convert_datetime() function determines the format of the datetimestr date/time string that it scans from the environment, as follows:
1. If the DBTIME environment variable is set, the function scans datetimestr according to DBTIME.
2. If the GL_DATETIME environment variable is set, the function scans datetimestr according to the specification of GL_DATETIME.
3. Otherwise, the function obtains the format from the value of the d_t_fmt subcategory of the LC_TIME category in the current GLS locale.
The function skips over the corresponding number of white-space characters in the datetimestr date/time string (unless the formatting directive begins with the minus-sign modifier), up to the first character that is not white space or until no more characters can be scanned. White-space characters are those that the blank class of the LC_CTYPE category in the current locale defines.
The function performs the specified conversion on the date or time element in the datetimestr date/time string. It replaces the formatting directive with an internal representation of the date or time element for conversion to the datetime value. There must be white-space or other nonalphanumeric characters between any two formatting directives.
The function must find the same ordinary character in the datetimestr date/time string. Any mismatch generates an error. The differing and subsequent characters in datetimestr remain unscanned.
(1 of 3)
Matches the day of the week. You can specify either the abbreviated or full name, which the abday and day subcategories of LC_TIME define, respectively. The directive ignores case when matching weekday names.
Matches the month. You can specify either the abbreviated or full name, which the abmon and mon subcategories of LC_TIME define, respectively. The directive ignores case when matching month names.
%c
Indicates use of the format that the d_t_fmt subcategory of the LC_TIME defines for the scan.
%D
Is the same as %m/%d/%y.
%F[n]
Matches the microsecond as a decimal number [0,999999]. Leading zeros are permitted but not required. An optional precision specification can follow the %F. This n value must be between 1 and 5.
%H
Matches the hour (24-hour clock) as a decimal number [00,23]. Leading zeros are permitted but not required.
%I
Matches the hour (12-hour clock) as a decimal number [00,12]. Leading zeros are permitted but not required. If %I is used without %p, then the function assumes A.M.
%M
Matches the minute as a decimal number [00,59]. Leading zeros are permitted but not required.
Matches any white space that the blank class of the LC_CTYPE category defines.
%p
Matches the equivalent of either A.M. or P.M. that the am_pm subcategory of LC_TIME defines.
%r
Indicates use of the format that the t_fmt_ampm subcategory of LC_TIME defines.
%R
Matches the time as %H:%M.
%S
Matches the second as a decimal number [0,61]. Leading zeros are permitted but not required.
Matches any white space that the space class of the LC_CTYPE category defines.
%T
Matches the time as %H:%M:%S.
%X
Indicates use of the format that the t_fmt subcategory of LC_TIME defines.
Matches a year within the century as a decimal number [00,99]. Leading zeros are permitted but not required. If %y is used without %C and the month and day of month are part of the datetimestr string, the function uses the value of the DBCENTURY environment variable to determine the century.
Matches a year that includes the century as a decimal number [0000,9999].
Matches the % character.
Use formats that include the era-based dates and times.
era, era_d_fmt, era_t_fmt, era_d_t_fmt
Use alternative locale-specific digits in dates and times.
The alternative format replaces one that an unmodified formatting directive normally uses. If the alternative format does not exist for the current locale, the behavior is the same as if unmodified formatting directives were used. The ifx_gl_convert_datetime() function supports the following modified formatting directives with the E and O modifiers.
%Ec
Indicates use of the format that the era_d_t_fmt subcategory of LC_TIME defines.
Matches the name of the base year (period). You can specify either the abbreviated or full name, which the era subcategory of LC_TIME defines.
Indicates use of the format that the era_d_fmt subcategory of LC_TIME defines.
%EX
Indicates use of the format that the era_t_fmt subcategory of LC_TIME defines.
Matches the year offset from %EC in the alternative representation, which the era subcategory of LC_TIME defines.
Matches the full alternative year representation that the era subcategory of LC_TIME defines.
%OH
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the hour (24-hour clock).
%OI
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the hour (12-hour clock).
%OM
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the minutes.
%OS
Uses the alternative digits that the alt_digits subcategory of LC_TIME defines to match the seconds.
The ifx_gl_convert_datetime() function needs the era base, era offset, day, and month to determine the year from era information. The function uses a default era offset of 1 if you specify era base, day, and month but not era offset. The ifx_gl_convert_datetime() function also supports the i modifier in the following formatting directives to support formats that are backward compatible with earlier Informix date and time formatting.
%iF[n]
Indicates use of the Informix DBTIME format %F. An optional precision specification, n, can follow F. This n value must be between 1 and 5.
Field Width You can specify an optional field width in a formatting directive. This information follows the initial percent symbol (%) of the formatting directive and has the following format:
If the specification begins with a minus sign (-), the function assumes that the field is left justified. In this case, the value being read must start with a digit and can have trailing spaces. The field can be preceded with leading spaces unless the first character in the field is a zero (0).
If the first character is a zero (0), the field is assumed to be right justified. Any padding to the left must use zeros.
Otherwise, the function assumes that the datetimestr string is right justified.
is a decimal value that specifies the maximum number of characters to read from the datetimestr date/time string.
Errors If an error occurred, this function returns -1 and sets the ifx_gl_lc_errno() error number to one of the following values.
IFX_GL_EFRACRANGE
Fraction of second is out of bounds.
IFX_GL_ESECONDRANGE
Second is out of bounds.
IFX_GL_EMINUTERANGE
Minute is out of bounds.
IFX_GL_EHOURRANGE
Hour is out of bounds.
IFX_GL_BADFRAC
Fraction could not be scanned.
IFX_GL_BADSECOND
Second could not be scanned.
IFX_GL_BADMINUTE
Minute could not be scanned.
IFX_GL_BADHOUR
Hour could not be scanned.
Era name not found.
Era offset could not be scanned.
Related Topics See the descriptions of the following functions: ifx_gl_convert_date(), ifx_gl_format_datetime(), and ifx_gl_lc_errno(). ifx_gl_convert_money() The ifx_gl_convert_money() function converts a money string to its internal money representation. Syntax
money
is a pointer to the variable that holds the internal money representation that ifx_gl_convert_money() creates from the monstr money string.
monstr
is a pointer to the format string that determines how to interpret the monstr money string. For more information, see "Format String".
Format String If format is NULL, the ifx_gl_convert_money() function determines the format of the monstr money string that it scans from the environment, as follows:
1. If the DBMONEY environment variable is set, the function scans monstr according to DBMONEY.
2. Otherwise, the function uses the formats in the LC_MONETARY category of the current GLS locale to scan the money value.
The function skips over the corresponding number of white-space characters in the monstr money string (unless the formatting directive begins with the minus-sign modifier), up to the first character that is not white space or until no more characters can be scanned. White-space characters are those that the blank class of the LC_CTYPE category in the current locale defines.
The function performs the specified conversion on the monetary element in the monstr money string. It replaces the formatting directive with an internal representation of the monetary element for conversion to the money value. Only one formatting directive is allowed in the format string.
The function must find the same ordinary character in the monstr money string. Any mismatch generates an error. The differing and subsequent characters in monstr remain unscanned.
%i
Matches the international monetary format (which uses the int_curr_symbol subcategory of the LC_MONETARY category in the current locale) for the monstr argument. For example, in the default locale, the international monetary format for 1,234.56 is the "USD 1,234.56" string. Declare the corresponding money value as (double *).
Matches the national currency format (which uses the currency_symbol of the LC_MONETARY category in the current locale) for the monstr argument. For example, in the default locale, the national monetary format for 1,234.56 is the "$1,234.56" string. Declare the corresponding money value as (double *).
Matches a % character. No corresponding argument is needed.
If a formatting directive does not correspond to any of the preceding directives, the behavior of the conversion is undefined. Field Width You can specify an optional field width in a formatting directive. This information follows the initial percent symbol (%) of the formatting directive and has the following format:
[']
indicates grouping rules.
If the specification begins with a single quote ('), the field is expected to follow the grouping rules in the LC_MONETARYcategory of the current locale.
[-]
If the specification begins with a minus sign (-), the function expects the first character of the monstr money string to be the first character of the value to be converted. The function does not skip over white-space characters in monstr but reports them as an error.
If you omit the minus sign (-), the function assumes that the monstr string is right justified, and it skips any initial white-space characters.
is a decimal value that specifies the maximum number of characters to read from the monstr money string.
Related Topics See the descriptions of the following functions: ifx_gl_convert_numeric(), ifx_gl_format_money(), and ifx_gl_lc_errno(). ifx_gl_convert_number() The ifx_gl_convert_number() function converts a number string to its internal decimal representation. Syntax
number
is a pointer to the variable that holds the internal decimal representation that ifx_gl_convert_number() creates from the numstr number string.
numstr
is a pointer to the format string that determines how to interpret the numstr number string. For more information, see "Format String".
Format String If format is NULL, the function uses the formats in the LC_NUMERIC category of the current GLS locale file to scan the numstr number string. If format is not NULL, it must point to a string that follows the rules that this section describes. To convert the numstr number string, ifx_gl_convert_number() compares each character in numstr with the format string. It takes the following actions for each possible kind of character that it finds in format.
The function skips over the corresponding number of white-space characters in the numstr number string (unless the formatting directive begins with the minus-sign modifier), up to the first character that is not white space or until no more characters can be scanned. White-space characters are those that the blank class of the LC_CTYPE category in the current locale defines.
The function performs the specified conversion on the numeric element in the numstr numeric string. It replaces the formatting directive with an internal representation of the numeric element for conversion to the number value. Only one formatting directive is allowed in the format string.
The function must find the same ordinary character in the numstr number string. Any mismatch generates an error. The differing and subsequent characters in numstr remain unscanned.
Matches a binary integer.
Matches a decimal integer.
Matches a floating-point number.
%E
Is the same as %e.
%f
%g
%G
%o
Matches an octal integer.
%q
Matches a base-4 integer.
Matches an unsigned decimal integer.
Matches a hexadecimal integer.
Is the same as %x.
If the specification begins with a minus sign (-), the functions expects the first character of the numstr number string to be the first character of the value to be converted. The function does not skip over white-space characters in numstr but reports them as an error.
If you omit the minus sign (-), the function assumes that the numstr string is right justified, and it skips any initial white-space characters.
is a decimal value that specifies the maximum number of characters to read from the numstr number string.
IFX_GL_PARAMERR
The type specifier in the formatting directive is invalid.
Related Topics See the descriptions of the following functions: ifx_gl_convert_money(), ifx_gl_format_number(), and ifx_gl_lc_errno(). ifx_gl_cv_mconv() The ifx_gl_cv_mconv() function converts characters from one code set to another. Syntax
state
points to a conv_state_t structure. For more information, see "Converting Fragmented Strings".
dst
dst_bytesleft
points to the maximum number of bytes to write into *dst.
src
points to a pointer to the first character in the source buffer.
src_bytesleft
Calculating the Size of the Destination Buffer The number of bytes written to *dst might be more or less than the number of bytes read from *src. You can determine the number of bytes that will be written to *dst in one of the following ways:
String is the first of n fragments.
String is the one of the 2nd, ..., nth-1 fragments.
String is the last (nth) fragment.
String is not fragmented; it is a complete string.
The code-set conversion was successful, and the *src, *src_bytesleft, *dst, and *dst_bytesleft arguments have been updated. If the entire source buffer is converted, the *srcbytesleft value is zero (0).
The function was not successful, and the error number is set to indicate the cause. See the Errors section. If the source conversion is stopped due to an error, the *srcbytesleft value is greater than zero (0).
IFX_GL_EILSEQ
The *src value contains an invalid character. Conversion stops after both the last successfully converted source and destination character.
IFX_GL_EINVAL
The function cannot determine whether the last character of *src is a valid character or the end of shift sequence because it would need to read more than *src_bytesleft bytes from *src. Conversion stops after the last successfully converted source and destination character. For more information about this error, see "Keeping Multibyte Strings Consistent".
IFX_GL_E2BIG
Not enough space is available in the destination buffer. Conversion stops after both the last successfully converted source and destination character.
Related Topics See the descriptions of the following functions: ifx_gl_conv_needed(), ifx_gl_cv_outbuflen(), ifx_gl_cv_sb2sb_table(), and ifx_gl_lc_errno(). For more information, see "Code-Set Conversion" and "Fragmenting Multibyte Strings".
ifx_gl_cv_outbuflen() The ifx_gl_cv_outbuflen() function calculates an approximation of the number of bytes required to store a case-converted multibyte character. Syntax
src_bytes
>=0
The number of bytes required to store multibyte characters of length src_bytes after they have been code-set converted.
Related Topics See the descriptions of the following functions: ifx_gl_conv_needed(), ifx_gl_cv_mconv(), ifx_gl_cv_sb2sb_table(), and ifx_gl_lc_errno(). For more information, see "Code-Set Conversion".
ifx_gl_cv_sb2sb_table() The ifx_gl_cv_sb2sb_table() function returns the single-byte conversion table from the source code set to the destination code set. Syntax
array
The function was successful, and the array argument points to the conversion table.
Related Topics See the descriptions of the following functions: ifx_gl_conv_needed(), ifx_gl_cv_mconv(), ifx_gl_cv_outbuflen(), and ifx_gl_lc_errno(). For more information, see "Code-Set Conversion".
ifx_gl_format_date() The ifx_gl_format_date() function formats an internal date value to a date string. Syntax
datebytes
is a pointer to the variable that holds the internal representation that ifx_gl_format_date() formats to create the datestr date string.
is a pointer to the format string that determines how to format the datestr date string. For more information, see "Format String".
Format String If format is NULL, the ifx_gl_format_date() function determines the format for the datestr date string that it creates from the environment, as follows:
1. If the DBDATE environment variable is set, the function formats datestr according to the order of the format elements in DBDATE.
2. If the GL_DATE environment variable is set, the function formats datestr according to the specification of GL_DATE.
3. Otherwise, the function obtains the formats from the d_fmt subcategory of the LC_TIME category in the current GLS locale.
Valid formatting directives
The function performs the specified formatting of the data in the date argument. It replaces the formatting directive with a string representation of a date element for the datestr date string.
The function copies the ordinary character unchanged to the datestr date string. Ordinary characters include the null terminator and white-space characters.
flag
For more information, see "Field Width and Precision".
width
precision
Replaced by the abbreviated weekday name that the abday subcategory of LC_TIME defines.
Replaced by the full weekday name that the day subcategory of LC_TIME defines.
Replaced by the abbreviated month name that the abmon subcategory of LC_TIME defines.
Replaced by the full month name that the mon subcategory of LC_TIME defines.
Replaced by the century number (the year divided by 100 and truncated to an integer as a decimal number [00-00]).
Replaced by the day of the month as a decimal number [01,31].
Replaced by the day of the month as a decimal number [1,31]; a single digit is preceded by a space.
Replaced by the day of the year as a decimal number [001,366].
Replaced by the month as a decimal number [01,12].
Replaced by a newline character.
Replaced by a tab character.
Replaced by the weekday as a decimal number [1,7], with 1representing Monday.
Replaced by the weekday as a decimal number [0,6], with 0 representing Sunday.
Replaced by year without century as a decimal number [00,99].
Replaced by year with century as a decimal number [00,99].
Replaced by the % symbol.
If a formatting directive does not correspond to any of the preceding directives, the behavior of the formatting is undefined. Modified Formatting Directives You can modify some formatting directives with format modifiers, which follow the percent symbol (%), to indicate use of an alternative format that the LC_TIME locale-file category of the current locale might define. The ifx_gl_format_date() function supports the following format modifiers.
The alternative format replaces one that an unmodified formatting directive normally uses. If the alternative format does not exist for the current locale, the behavior is the same as if unmodified formatting directives were used. The ifx_gl_format_date() function supports the following modified formatting directives with the E and O modifiers.
Replaced by the name of the base year (period) that the era subcategory of LC_TIME defines.
Replaced by the abbreviated name of the base year (period) that the era subcategory of LC_TIME defines.
The value of the era_d_fmt subcategory of the LC_TIME category for the current locale is temporarily used as the format string.
Replaced by the offset from %EC (year only) that the era subcategory of LC_TIME defines.
Replaced by the full alternative year representation that the era subcategory of LC_TIME defines.
Replaced by the day of the month, using the alternative digits that the alt_digits subcategory of LC_TIME defines. This formatting directive fills as needed with leading spaces.
Replaced by the month using the alternative digits that the alt_digits subcategory of LC_TIME defines.
%Ou
Replaced by the weekday as a number using the alternative digits that the alt_digits subcategory of LC_TIME defines (Monday=1).
Replaced by the value of %Ey using the alternative digits that the alt_digits subcategory of LC_TIME defines.
The ifx_gl_format_date() function also supports the i modifier in the following formatting directives to support formats that are backward compatible with earlier Informix date and time formatting.
Replaced by the Informix DBDATE format Y2. This format prints the two-digit year offset.
Replaced by the Informix DBDATE format Y4. This format prints the full four-digit year.
Field Width and Precision You can also specify an optional field width and precision in a formatting directive. This information precedes the type specifier in the formatting directive and has the following format:
[- | 0]
If the specification begins with a minus sign (-), the function left-justifies the field and pads it with spaces on the right.
If the value begins with a zero (0), the function right-justifies the field and pads it with zeros on the left.
Otherwise, the function right-justifies the field and pads it with spaces on the left.
is a decimal value that specifies a minimum field width for the formatted datestr value.
has the format of a period (.) followed by a decimal value. The field width specifier can optionally be followed by a precision directive. For more information on the purpose of precision, see the following table.
%C, %d, %e, %Ey, %iy, %iY, %j, %m, %u, %w, %y, %Y
The value of precision specifies the minimum number of digits to appear. If a directive supplies fewer digits than the precision specifies, the function pads the value with leading zeros.
The %d, %Ey, %iy, %m, %u, %w, and %y directives have a default precision of 2. The %j directive has a default precision of 3. The %Y and %iY directives have a default precision of 4.
%a, %A, %b, %B, %EC, %Eg, %h
The value of precision specifies the maximum number of characters to be used. If a value to be formatted has more characters than the precision specifies, the function truncates the result on the right.
%Ex, %EY, %n, %t, %x, %%
The values of width and precision do not affect these directives.
Directives modified with O (alternative digits)
The field width relates to display width rather than actual number of digits. The precision is still the minimum number of digits printed.
Locale Information The LC_TIME category of the current locale affects the behavior of this function because it provides the locale-specific information for the formatting of the date value. For more information, see "The LC_TIME Locale-File Category".
The formatting directive is invalid.
Related Topics See the descriptions of the following functions: ifx_gl_convert_date(), ifx_gl_format_datetime(), and ifx_gl_lc_errno(). ifx_gl_format_datetime() The ifx_gl_format_datetime() function formats an internal date/time value to a date/time string. Syntax
datetimebytes
is a pointer to the variable that holds the internal representation that ifx_gl_format_datetime() formats to create the datetimestr date/time string.
is a pointer to the format string that determines how to format the datetimestr date/time string. For more information, see "Format String".
Format String If format is NULL, the ifx_gl_format_datetime() function determines the format for the datetimestr date/time string that it creates from the environment, as follows:
1. If the DBTIME environm