1.9.8 LC_TIME data block

The LC_TIME data block configures formatting of date and time values.

When defining a locale data block in the C library, the macros that define an LC_TIME data block are as follows:

  1. Call LC_TIME_begin with a symbol name and a locale name.

  2. Call the LC_TIME data macros as follows:

    1. 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.

    2. 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.

    3. Call LC_TIME_am_pm with two arguments that are respectively the strings representing morning and afternoon.

    4. 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. The example below shows that the standard date/time format is permitted to reference the other two formats.

    5. Call LC_TIME_c99format with a single string that is the standard 12-hour time format used in strftime("%r") as defined in C99.

  3. Call LC_TIME_end, without arguments, to finish the locale block definition.

Example LC_TIME data block

        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 "%a %b %e %T %Y", "%m/%d/%y", "%H:%M:%S"
        LC_TIME_c99format "%I:%M:%S %p"
        LC_TIME_end
Non-ConfidentialPDF file icon PDF versionARM DUI0475M
Copyright © 2010-2016 ARM Limited or its affiliates. All rights reserved.