The LC_TOD category source definition in locale source files defines the rules that determine the beginning, end, and duration of daylight savings time and the difference between local time and Coordinated Universal Time (UTC) in the locale that is compiled from that source by the LOCALDEF utility. The LC_TOD category is not defined in any of the locales that ship with IBM C and C++ Compilers. To specify time zone and daylight savings time information, you must either add LC_TOD and rebuild the locale or use the tzset function.
The following keywords make up this category definition:
Note:
The start_week and end_week need not be used. The start_day and end_day fields can specify either the day of the week or the
day of the month. If day of month is specified, start_week and end_week become redundant
copy
Specifies the name of an existing locale to be used as the source
for the definition of this category. If this keyword is
specified, no other keyword should be present in this category.
If the locale is not found, an error is reported and no locale
output is created. The copy
keyword cannot specify a locale that also specifies the copy keyword for the same category.
timezone_difference
An integer specifying the time zone difference expressed in
minutes. If the local time zone is west of the Greenwich
Meridian, this value must be positive. If the local time zone is
east of the Greenwich Meridian, this value must be negative. An
absolute value greater than 1440 (the number of minutes in a day)
for this keyword indicates that the run time library is to get
the time zone difference from the system.
timezone_name
A string specifying the time zone name such as "PST"
(Pacific Standard Time) specified within quotation marks. The
default for this field is a NULL string.
daylight_name
A string specifying the Daylight Saving Time zone name, such as
"Ph4" (Pacific Daylight Time), if there is one
available. The string must be specified within quotation marks.
If DST information is not available, this is set to NULL, which
is also the default. This field must be filled in if DST
information as provided by the other fields is to be taken into
account by the mktime and localtime functions. These functions
ignore DST if this field is NULL.
start_month
An integer specifying the month of the year when Daylight Saving
Time comes into effect. This value ranges from 1 through 12
inclusive, with 1 corresponding to January and 12 corresponding
to December. If DST is not applicable to a locale, start_month is
set to 0, which is also the default.
end_month
An integer specifying the month of the year when Daylight Saving
Time ceases to be in effect. The specifications are similar to
those for start_month.
start_week
An integer specifying the week of the month when
DST comes into effect. Acceptable values range from -4 to +4. A
value of 4 means the fourth week of the month, while a value of
-4 means fourth week of the month, counting from the end of the
month. Sunday is considered to be the start of the week. If DST
is not applicable to a locale, start_week is set to 0, which is
also the default.
end_week
An integer specifying the week of the month when DST ceases to be
in effect. The specifications are similar to those for start_week.
start_day
An integer specifying the day of the week or the day of the month
when DST comes into effect. The value depends on the value of start_week. If start_week is not equal to 0, this
is the day of the week when DST comes into effect. It ranges from
0 through 6 inclusive, with 0
corresponding to Sunday and 6
corresponding to Saturday. If start_week equals 0, start_day is the day of the month (for the current year) when DST
comes into effect. It ranges from 1
through to the last day of the month inclusive. The last day of
the month is 31 for January, March, May, July, August, October, and
December. It is 30 for April, June, September, and November. For February,
it is 28 on non-leap years and 29 on
leap years. If DST is not applicable to a locale, start_day is set to 0, which is also the default.
end_day
An integer specifying the day of the week or the day of the month
when DST ceases to be in effect. The specifications are similar
to those for start_day.
start_time
An integer specifying the number of seconds after 12:00 midnight,
local standard time, when DST comes into effect. For example, if
DST is to start at 2:00 am, start_time is assigned the value 7200;
for 12:00 am (midnight), start_time is 0; for 1:00 am, it is 3600.
end_time
An integer specifying the number of seconds after 12 midnight,
local standard time, when DST ceases to be in effect. The
specifications are similar to those for start_time.
shift
An integer specifying the DST time shift, expressed in seconds.
The default is 3600, for 1 hour.
uctname
A string specifying the name to be used for Coordinated Universal
Time. If this keyword is not specified, the uctname will default
to "UTC".
Example: LC_TOD Locale Category Definition
![]()
Internationalization
Localization
and Locales
![]()
Locale Categories
Locale Source Files