[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]
Files Reference

LC_TIME Category for the Locale Definition Source File Format

Purpose

Defines rules and symbols for formatting time and date information.

Description

The LC_TIME category of a locale definition source file defines rules and symbols for formatting time and date information. This category begins with an LC_TIME category header and terminates with an END LC_TIME category trailer.

Keywords

All operands for the LC_TIME category keywords are defined as string or integer values. String values are enclosed by " " (double-quotation marks). All values are separated from the keyword they define by one or more spaces. Two adjacent double-quotation marks indicate an undefined string value. A -1 indicates an undefined integer value. Field descriptors are used by commands and subroutines that query the LC_TIME category to represent elements of time and date formats. The following keywords are recognized in the LC_TIME category:

copy The copy statement specifies the name of an existing locale to be used as the definition of this category. If a copy statement is included in the file, no other keyword can be specified.
abday Defines the abbreviated weekday names corresponding to the %a field descriptor. Recognized values consist of 7 semicolon-separated strings. Each string must be of equal length and contain 5 characters or less. The first string corresponds to the abbreviated name (Sun) for the first day of the week (Sunday), the second to the abbreviated name for the second day of the week, and so on.
day Defines the full spelling of the weekday names corresponding to the %A field descriptor. Recognized values consist of seven semicolon-separated strings. The first string corresponds to the full spelling of the name of the first day of the week (Sunday), the second to the name of the second day of the week, and so on.
abmon Defines the abbreviated month names corresponding to the %b field descriptor. Recognized values consist of 12 semicolon-separated strings. Each string must be of equal length and contain 5 characters or less. The first string corresponds to the abbreviated name (Jan) for the first month of the year (January), the second to the abbreviated name for the second month of the year, and so on.
mon Defines the full spelling of the month names corresponding to the %B field descriptor. Recognized values consist of 12 semicolon-separated strings. The first string corresponds to the full spelling of the name for the first month of the year (January), the second to the full spelling of the name for the second month of the year, and so on.
d_t_fmt Defines the string used for the standard date and time format corresponding to the %c field descriptor. The string can contain any combination of characters and field descriptors.
d_fmt Defines the string used for the standard date format corresponding to the %x field descriptor. The string can contain any combination of characters and field descriptors.
t_fmt Defines the string used for the standard time format corresponding to the %X field descriptor. The string can contain any combination of characters and field descriptors.
am_pm Defines the strings used to represent ante meridiem (before noon) and post meridiem (after noon) corresponding to the %p field descriptor. Recognized values consist of two semicolon-separated strings. The first string corresponds to the ante meridiem designation, the last string to the post meridiem designation.
t_fmt_ampm Defines the string used for the standard 12-hour time format that includes an am_pm value (the %p field descriptor). This statement corresponds to the %r field descriptor. The string can contain any combination of characters and field descriptors.
era Defines how the years are counted and displayed for each era (or emperor's reign) in a locale, corresponding to the %E field descriptor modifier. For each era, there must be one string in the following format:
direction:offset:start_date:end_date:name:format

The variables for the era-string format are defined as follows:

direction Specifies a - (minus sign) or + (plus sign) character. The plus sign character indicates that years count in the positive direction when moving from the start date to the end date. The minus sign character indicates that years count in the negative direction when moving from the start date to the end date.
offset Specifies a number representing the first year of the era.
start_date Specifies the starting date of the era in the yyyy/mm/dd format, where yyyy, mm, and dd are the year, month, and day, respectively. Years prior to the year AD 1 are represented as negative numbers. For example, an era beginning March 5th in the year 100 BC would be represented as -100/03/05.
end_date Specifies the ending date of the era in the same form used for the start_date variable or one of the two special values -* or +*. A -* value indicates that the ending date of the era extends backward to the beginning of time. A +* value indicates that the ending date of the era extends forward to the end of time. Therefore, the ending date can be chronologically before or after the starting date of the era. For example, the strings for the Christian eras AD and BC would be entered as follows:
+:0:0000/01/01:+*:AD:%o %N
+:1:-0001/12/31:-*:BC:%o %N
name Specifies a string representing the name of the era that is substituted for the %N field descriptor.
format Specifies a string for formatting the %E field descriptor. This string is usually a function of the %o and %N field descriptors.

An era value consists of one string for each era. If more than one era is specified, each era string is separated by a ; (semicolon).

era_year Defines the string used to represent the year in alternate-era format corresponding to the %Ey field descriptor. The string can contain any combination of characters and field descriptors.
era_d_fmt Defines the string used to represent the date in alternate-era format corresponding to the %Ex field descriptor. The string can contain any combination of characters and field descriptors.
era_t_fmt Defines the alternative time format of the locale, as represented by the %EX field descriptor for the strftime subroutine.
era_d_t_fmt Defines the alternative date and time format of the locale, as represented by the %Ec field descriptor for the strftime subroutine.
alt_digits Defines alternate strings for digits corresponding to the %o field descriptor. Recognized values consist of a group of semicolon-separated strings. The first string represents the alternate string for 0, the second string represents the alternate string for one, and so on. A maximum of 100 alternate strings can be specified.

Field Descriptors

The LC_TIME locale definition source file uses field descriptors to represent elements of time and date formats. Combinations of these field descriptors create other field descriptors or create time-and-date format strings. When used in format strings containing field descriptors and other characters, field descriptors are replaced by their current values. All other characters are copied without change. The following field descriptors are used by commands and subroutines that query the LC_TIME category for time formatting:

%a Represents the abbreviated weekday name (for example, Sun) defined by the abday statement.
%A Represents the full weekday name (for example, Sunday) defined by the day statement.
%b Represents the abbreviated month name (for example, Jan) defined by the abmon statement.
%B Represents the full month name (for example, January) defined by the month statement.
%c Represents the time-and-date format defined by the d_t_fmt statement.
%C Represents the century as a decimal number (00 to 99).
%d Represents the day of the month as a decimal number (01 to 31).
%D Represents the date in %m/%d/%y format (for example, 01/31/91).
%e Represents the day of the month as a decimal number (01 to 31). The %e field descriptor uses a two-digit field. If the day of the month is not a two-digit number, the leading digit is filled with a space character.
%Ec Specifies the locale's alternate appropriate date and time representation.
%EC Specifies the name of the base year (period) in the locale's alternate representation.
%Ex Specifies the locale's alternate date representation.
%EX Specifies the locale's alternate time representation.
%Ey Specifies the offset from the %EC (year only) field descriptor in the locale's alternate representation.
%EY Specifies the full alternate year representation.
%Od Specifies the day of the month using the locale's alternate numeric symbols.
%Oe Specifies the day of the month using the locale's alternate numeric symbols.
%OH Specifies the hour (24-hour clock) using the locale's alternate numeric symbols.
%OI Specifies the hour (12-hour clock) using the locale's alternate numeric symbols.
%Om Specifies the month using the locale's alternate numeric symbols.
%OM Specifies the minutes using the locale's alternate numeric symbols.
%OS Specifies the seconds using the locale's alternate numeric symbols.
%OU Specifies the week number of the year (Sunday as the first day of the week) using the locale's alternate numeric symbols.
%Ow Specifies the weekday as a number in the locale's alternate representation (Sunday = 0).
%OW Specifies the week number of the year (Monday as the first day of the week) using the locale's alternate numeric symbols.
%Oy Specifies the year (offset from the %C field descriptor) in alternate representation.
%h Represents the abbreviated month name (for example, Jan) defined by the abmon statement. This field descriptor is a synonym for the %b field descriptor.
%H Represents the 24-hour clock hour as a decimal number (00 to 23).
%I Represents the 12-hour clock hour as a decimal number (01 to 12).
%j Represents the day of the year as a decimal number (001 to 366).
%m Represents the month of the year as a decimal number (01 to 12).
%M Represents the minutes of the hour as a decimal number (00 to 59).
%n Specifies a new-line character.
%N Represents the alternate era name.
%o Represents the alternate era year.
%p Represents the a.m. or p.m. string defined by the am_pm statement.
%r Represents the 12-hour clock time with a.m./p.m. notation as defined by the t_fmt_ampm statement.
%S Represents the seconds of the minute as a decimal number (00 to 59).
%t Specifies a tab character.
%T Represents 24-hour clock time in the format %H:%M:%S (for example, 16:55:15).
%U Represents the week of the year as a decimal number (00 to 53). Sunday, or its equivalent as defined by the day statement, is considered the first day of the week for calculating the value of this field descriptor.
%w Represents the day of the week as a decimal number (0 to 6). Sunday, or its equivalent as defined by the day statement, is considered as 0 for calculating the value of this field descriptor.
%W Represents the week of the year as a decimal number (00 to 53). Monday, or its equivalent as defined by the day statement, is considered the first day of the week for calculating the value of this field descriptor.
%x Represents the date format defined by the d_fmt statement.
%X Represents the time format defined by the t_fmt statement.
%y Represents the year of the century (00 to 99).
Note: When the environment variable XPG_TIME_FMT=ON, %y is the year within the century. When a century is not otherwise specified, values in the range 69-99 refer to years in the twentieth century (1969 to 1999, inclusive); values in the range 00-68 refer to 2000 to 2068, inclusive.
%Y Represents the year as a decimal number (for example, 1989).
%Z Represents the time-zone name, if one can be determined (for example, EST); no characters are displayed if a time zone cannot be determined.
%% Specifies a % (percent sign) character.

Example

The following is an example of a possible LC_TIME category listed in a locale definition source file:

LC_TIME
#
#Abbreviated weekday names (%a)
abday   "<S><u><n>";"<M><o><n>";"<T><u><e>";"<W><e><d>";\
        "<T><h><u>";"<F><r><i>";"<S><a><t>"
#
#Full weekday names (%A)
day     "<S><u><n><d><a><y>";"<M><o><n><d><a><y>";\
        "<T><u><e><s><d><a><y>";"<W><e><d><n><e><s><d><a><y>";\
        "<T><h><u><r><s><d><a><y>";"<F><r><i><d><a><y>";\
        "<S><a><t><u><r><d><a><y>"
#
#Abbreviated month names (%b)
abmon   "<J><a><n>";"<F><e><b>";"<M><a><r>";"<A><p><r>";\
        "<M><a><y>";"<J><u><n>";"<J><u><l>";"<A><u><g>";\
        "<S><e><p>";"<O><c><t>";"<N><o><v>";"<D><e><c>"
#
#Full month names (%B)
mon     "<J><a><n><u><a><r><y>";"<F><e><b><r><u><a><r><y>";\
        "<M><a><r><c><h>";"<A><p><r><i><l>";"<M><a><y>";\
        "<J><u><n><e>";"<J><u><l><y>";"<A><u><g><u><s><t>";\
        "<S><e><p><t><e><m><b><e><r>";"<O><c><t><o><b><e><r>";\
        "<N><o><v><e><m><b><e><r>";"<D><e><c><e><m><b><e><r>"
#
#Date and time format (%c)
d_t_fmt "%a %b %d %H:%M:%S %Y"
#
#Date format (%x)
d_fmt           "%m/%d/%y"
#
#Time format (%X)
t_fmt           "%H:%M:%S"
#
#Equivalent of AM/PM (%p)
am_pm           "<A><M>";"<P><M>"
#
#12-hour time format (%r)
t_fmt_ampm      "%I:%M:%S %p"
#
era             "+:0:0000/01/01:+*:AD:%o %N";\
                "+:1:-0001/12/31:-*:BC:%o %N"
era_year        ""
era_d_fmt       ""
alt_digits      "<0><t><h>";"<1><s><t>";"<2><n><d>";"<3><r><d>";\
                "<4><t><h>";"<5><t><h>";"<6><t><h>";"<7><t><h>";\
                "<8><t><h>";"<9><t><h>";"<1><0><t><h>"
#
END LC_TIME

Implementation Specifics

This category of the locale definition source file format is part of the Base Operating System (BOS) Runtime.

Files

/usr/lib/nls/loc/* Specifies locale definition source files for supported locales.
/usr/lib/nls/charmap/* Specifies character set description (charmap) source files for supported locales.

Related Information

The locale command, localedef command.

The strftime subroutine.

Character Set Description (charmap) Source File Format , Locale Definition Source File Format , Locale Method Source File Format .

For specific information about other locale categories and their keywords, see the LC_COLLATE category, LC_CTYPE category, LC_MESSAGES category, LC_MONETARY category, and LC_NUMERIC category for the locale definition source file format.

Changing Your Locale and Understanding the Locale Definition Source File in AIX Version 4.3 System Management Concepts: Operating System and Devices.


[ Next Article | Previous Article | Book Contents | Library Home | Legal | Search ]