localdtconv() — Date and time formatting convention inquiry

Standards

Standards / Extensions C or C++ Dependencies
Language Environment both  

Format

#include <locale.h>

struct dtconv *localdtconv(void);

General description

Determines the date/time format information of the current locale.

To avoid infringing on the user's name space, this nonstandard function has two names. One name is prefixed with two underscore characters, and one name is not. The name without the prefix underscore characters is exposed only when you use LANGLVL(EXTENDED).

To use this function, you must either invoke the function using its external entry point name (that is, the name that begins with two underscore characters), or compile with LANGLVL(EXTENDED). When you use LANGLVL(EXTENDED) any relevant information in the header is also exposed.

Returned value

Returns the address of the dtconv structure:
struct dtconv {
        char *abbrev_month_names[12];   /* Abbreviated month names      */
        char *month_names[12];          /* full month names             */
        char *abbrev_day_names[7];      /* Abbreviated day names        */
        char *day_names[7];             /* full day names               */
        char *date_time_format;         /* date and time format         */
        char *date_format;              /* date format                  */
        char *time_format;              /* time format                  */
        char *am_string;                /* AM string                    */
        char *pm_string;                /* PM string                    */
        char *time_format_ampm;         /* long date format             */
        char *iso_std8601_2000;         /* ISO 8601:2000 std date format*/
};

The dtconv structure is an IBM® extension that stores values from the LC_TIME category of the current locale. It is initialized by the setlocale() function and copied to the user-supplied dtconv when localdtconv() is called.

The dtconv structure can be overwritten by subsequent calls to localdtconv() and setlocale() with LC_ALL or LC_TIME.

Related information