| |||
| Home > The ARM C and C++ libraries > LC_TIME data block | |||
When defining a locale data block in the C library, the macros
that define an LC_TIME data block are as follows:
Call LC_TIME_begin with a symbol
name and a locale name.
Call the LC_TIME data macros
as follows:
Call LC_TIME_week_short seven
times to provide the short names for the days of the week. Sunday
being the first day. Then call LC_TIME_week_long and
repeat the process for long names.
Call LC_TIME_month_short twelve
times to provide the short names for the days of the month. Then
call LC_TIME_month_long and repeat the process
for long names.
Call LC_TIME_am_pm with two arguments
that are respectively the strings representing morning and afternoon.
Call LC_TIME_formats with three
arguments that are respectively the standard date/time format used
in strftime("%c"), the standard date format strftime("%x"), and
the standard time format strftime("%X"). These
strings must define the standard formats in terms of other simpler strftime primitives. Example 8 shows that the standard
date/time format is permitted to reference the other two formats.
Call LC_TIME_c99format with a
single string that is the standard 12-hour time format used in strftime("%r") as
defined in C99.
Call LC_TIME_end, without arguments,
to finish the locale block definition.
The following example shows an LC_TIME data
block.
Example 8. Defining the TIME locale
LC_TIME_begin c_time, "C" LC_TIME_week_short "Sun" LC_TIME_week_short "Mon" LC_TIME_week_short "Tue" LC_TIME_week_short "Wed" LC_TIME_week_short "Thu" LC_TIME_week_short "Fri" LC_TIME_week_short "Sat" LC_TIME_week_long "Sunday" LC_TIME_week_long "Monday" LC_TIME_week_long "Tuesday" LC_TIME_week_long "Wednesday" LC_TIME_week_long "Thursday" LC_TIME_week_long "Friday" LC_TIME_week_long "Saturday" LC_TIME_month_short "Jan" LC_TIME_month_short "Feb" LC_TIME_month_short "Mar" LC_TIME_month_short "Apr" LC_TIME_month_short "May" LC_TIME_month_short "Jun" LC_TIME_month_short "Jul" LC_TIME_month_short "Aug" LC_TIME_month_short "Sep" LC_TIME_month_short "Oct" LC_TIME_month_short "Nov" LC_TIME_month_short "Dec" LC_TIME_month_long "January" LC_TIME_month_long "February" LC_TIME_month_long "March" LC_TIME_month_long "April" LC_TIME_month_long "May" LC_TIME_month_long "June" LC_TIME_month_long "July" LC_TIME_month_long "August" LC_TIME_month_long "September" LC_TIME_month_long "October" LC_TIME_month_long "November" LC_TIME_month_long "December" LC_TIME_am_pm "AM", "PM" LC_TIME_formats "%x %X", "%d %b %Y", "%H:%M:%S" LC_TIME_c99format "%I:%M:%S %p" LC_TIME_week_short "Sat" LC_TIME_end