Tizen Native API  8.0

The Udate module consists of functions that convert dates and time from their internal representations to textual form and back again in a language-independent manner.

Required Header

#include <utils_i18n.h>

Overview

The Udate module consists of functions that convert dates and time from their internal representations to textual form and back again in a language-independent manner. Converting from the internal representation (milliseconds since midnight, January 1, 1970) to text is known as "formatting," and converting from text to milliseconds is known as "parsing". We currently define only one concrete handle i18n_udate_format_h, which can handle pretty much all normal date formatting and parsing actions.
The Udate module helps you format and parse dates for any locale. Your code can be completely independent of the locale conventions for months, days of the week, or even the calendar format: lunar vs. solar.

Sample Code 1

Gets the best pattern according to a given locale and formats a current date and time using a locale_udate_format_h

    i18n_udatepg_h pattern_generator = NULL;
    char *locale = I18N_ULOCALE_US;

    dlog_print(DLOG_INFO, LOG_TAG, "pattern_generator\n");

    if(!pattern_generator) {
        // create a pattern generator according to a given locale
        i18n_udatepg_create(locale, &pattern_generator);
    }

    if(!pattern_generator) {
        dlog_print(DLOG_INFO, LOG_TAG, "i18n_udatepg_create fail");
        return ;
    }

    i18n_uchar bestPattern[64] = {0,};
    char bestPatternString[64] = {0,};
    int bestPatternLength, len;
    const char *custom_format = "yyyy.MM.dd G 'at' HH:mm:ss zzz";
    i18n_uchar uch_custom_format[64];
    int ret = I18N_ERROR_NONE;

    dlog_print(DLOG_INFO, LOG_TAG, "getBestPattern\n");

    i18n_ustring_copy_ua(uch_custom_format, custom_format);
    len = i18n_ustring_get_length(uch_custom_format);

    // gets the best pattern that matches the given custom_format
    i18n_udatepg_get_best_pattern(pattern_generator, uch_custom_format, len, bestPattern, 64, &bestPatternLength);

    i18n_ustring_copy_au_n(bestPatternString, bestPattern, 64);
    // gets "MM/dd/yyyy G h:mm:ss a zzz" as the best pattern
    dlog_print(DLOG_INFO, LOG_TAG, "getBestPattern(char[]) : %s \n", bestPatternString);

    // closes a generator
    i18n_udatepg_destroy(pattern_generator);

    i18n_udate_format_h formatter_KR = NULL;
    i18n_udate_format_h formatter_LA = NULL;
    i18n_udate_format_h formatter_SaoPaulo = NULL;
    i18n_uchar formatted[64] = {0,};
    char result[64] = {0,};
    int formattedLength;
    i18n_udate date;
    const char *timezone_KR = "GMT+9:00";   // TimeZone for Korea/Seoul
    const char *timezone_LA = "America/Los_Angeles";
    const char *timezone_SaoPaulo = "America/Sao_Paulo";    // Brazil/East
    i18n_uchar utf16_timezone_KR[64] = {0,};
    i18n_uchar utf16_timezone_LA[64] = {0,};
    i18n_uchar utf16_timezone_SaoPaulo[64] = {0,};

    i18n_ustring_copy_ua_n(utf16_timezone_KR, timezone_KR, strlen(timezone_KR));
    i18n_ustring_copy_ua_n(utf16_timezone_LA, timezone_LA, strlen(timezone_LA));
    i18n_ustring_copy_ua_n(utf16_timezone_SaoPaulo, timezone_SaoPaulo, strlen(timezone_SaoPaulo));

    // creates new i18n_udate_format_h to format dates and times
    ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_KR, -1, bestPattern, -1, &formatter_KR);
    if (ret != I18N_ERROR_NONE) {
        dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n");
    }
    if (!formatter_KR) {
        dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n");
    }
    ret = i18n_udate_create(I18N_UDATE_FULL , I18N_UDATE_FULL , locale, utf16_timezone_LA, -1, bestPattern, -1, &formatter_LA);
    if (ret != I18N_ERROR_NONE) {
        dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n");
    }
    if (!formatter_LA) {
        dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n");
    }
    ret = i18n_udate_create(I18N_UDATE_PATTERN , I18N_UDATE_PATTERN , locale, utf16_timezone_SaoPaulo, -1, bestPattern, -1, &formatter_SaoPaulo);
    if (ret != I18N_ERROR_NONE) {
        dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_create failed !!! \n");
    }
    if (!formatter_SaoPaulo) {
        dlog_print(DLOG_INFO, LOG_TAG, "formatter is NULL\n");
    }

    dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_format_date\n");

    // gets the current date and time
    i18n_ucalendar_get_now(&date);

    // formats a date using i18n_udate_format_h
    i18n_udate_format_date(formatter_KR, date, formatted, 64, NULL, &formattedLength);
    i18n_ustring_copy_au_n(result, formatted, 64);
    //ex) KOREA/Seoul - Current date : Wednesday, June 18, 2014 1:34:54 PM GMT+09:00
    dlog_print(DLOG_INFO, LOG_TAG, "KOREA/Seoul - Current date : %s\n",result);

    // formats a date using i18n_udate_format
    i18n_udate_format_date(formatter_LA, date, formatted, 64, NULL, &formattedLength);
    i18n_ustring_copy_au_n(result, formatted, 64);
    //ex) America/LOS Angeles - Current date : Tuesday, June 17, 2014 9:34:54 PM Pacific Daylight Time
    dlog_print(DLOG_INFO, LOG_TAG, "America/LOS Angeles - Current date : %s\n",result);

    // formats a date using i18n_udate_format_h
    i18n_udate_format_date(formatter_SaoPaulo, date, formatted, 64, NULL, &formattedLength);
    i18n_ustring_copy_au_n(result, formatted, 64);
    //ex) Brazil/Sao Paulo - Current date : 6 18, 2014 AD, 1:34:54 PM GMT-2
    dlog_print(DLOG_INFO, LOG_TAG, "Brazil/Sao Paulo - Current date : %s\n",result);

    dlog_print(DLOG_INFO, LOG_TAG, "i18n_udate_destroy\n");
    // destroy an i18n_udate_format_h
    i18n_udate_destroy(formatter_SaoPaulo);
    i18n_udate_destroy(formatter_LA);
    i18n_udate_destroy(formatter_KR);

Functions

int i18n_udate_create (i18n_udate_format_style_e time_style, i18n_udate_format_style_e date_style, const char *locale, const i18n_uchar *tz_id, int32_t tz_id_len, const i18n_uchar *pattern, int pattern_len, i18n_udate_format_h *format)
 Creates a new i18n_udate_format_h for formatting and parsing dates and times.
int i18n_udate_destroy (i18n_udate_format_h format)
 Destroys an i18n_udate_format_h.
int i18n_udate_format_date (const i18n_udate_format_h format, i18n_udate date_to_format, i18n_uchar *result, int32_t result_len, i18n_ufield_position_h pos, int32_t *buf_size_needed)
 Formats a date using an i18n_udate_format_h.
int i18n_udate_to_calendar_date_field (i18n_udate_format_field_e field, i18n_ucalendar_date_fields_e *date_field_type)
 Maps from an i18n_udate_format_h to the corresponding i18n_ucalendar_date_fields_e.
int i18n_udate_clone (const i18n_udate_format_h format, i18n_udate_format_h *format_clone)
 Creates a copy of an i18n_udate_format_h.
int i18n_udate_parse (const i18n_udate_format_h format, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos, i18n_udate *parsed_date)
 Parses a string into an date/time using an i18n_udate_format_h.
int i18n_udate_parse_calendar (const i18n_udate_format_h format, i18n_ucalendar_h *calendar, const i18n_uchar *text, int32_t text_length, int32_t *parse_pos)
 Parses a string into an date/time using an i18n_udate_format_h.
i18n_ubool i18n_udate_is_lenient (const i18n_udate_format_h format)
 Determines if an i18n_udate_format_h will perform lenient parsing.
int i18n_udate_set_lenient (i18n_udate_format_h format, i18n_ubool is_lenient)
 Specifies whether an i18n_udate_format_h will perform lenient parsing.
int i18n_udate_get_calendar (const i18n_udate_format_h format, i18n_ucalendar_h *calendar)
 Gets the i18n_ucalendar_h associated with an i18n_udate_format_h.
int i18n_udate_set_calendar (i18n_udate_format_h format, const i18n_ucalendar_h calendar_to_set)
 Sets the i18n_ucalendar_h associated with an i18n_udate_format_h.
int i18n_udate_get_number_format (const i18n_udate_format_h format, i18n_unumber_format_h *number_format)
 Gets the i18n_unumber_format_h associated with an i18n_udate_format_h.
int i18n_udate_set_number_format (i18n_udate_format_h format, const i18n_unumber_format_h number_format_to_set)
 Sets the i18n_unumber_format_h associated with an i18n_udate_format_h.
const char * i18n_udate_get_available (int32_t locale_index)
 Gets a locale for which date/time formatting patterns are available.
int32_t i18n_udate_count_available (void)
 Determines how many locales have date/time formatting patterns available.
int i18n_udate_get_2digit_year_start (const i18n_udate_format_h format, i18n_udate *year)
 Gets the year relative to which all 2-digit years are interpreted.
int i18n_udate_set_2digit_year_start (i18n_udate_format_h format, i18n_udate date)
 Sets the year relative to which all 2-digit years will be interpreted.
int32_t i18n_udate_to_pattern (const i18n_udate_format_h format, i18n_ubool localized, i18n_uchar *result, int32_t result_length)
 Extracts the pattern from an i18n_udate_format_h.
int i18n_udate_apply_pattern (i18n_udate_format_h format, i18n_ubool localized, const i18n_uchar *pattern, int32_t pattern_length)
 Sets the pattern used by an i18n_udate_format_h.
int32_t i18n_udate_get_symbols (const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, i18n_uchar *result, int32_t result_length)
 Gets the symbols associated with an i18n_udate_format_h.
int32_t i18n_udate_count_symbols (const i18n_udate_format_h format, i18n_udate_format_symbol_type_e type)
 Counts the number of particular symbols for an i18n_udate_format_h.
int i18n_udate_set_symbols (i18n_udate_format_h format, i18n_udate_format_symbol_type_e type, int32_t symbol_index, i18n_uchar *value, int32_t value_length)
 Sets the symbols associated with an i18n_udate_format_h.
const char * i18n_udate_get_locale_by_type (const i18n_udate_format_h format, i18n_ulocale_data_locale_type_e type)
 Gets the locale for this date format object.
int i18n_udate_set_context (i18n_udate_format_h format, i18n_udisplay_context_e value)
 Sets a particular i18n_udisplay_context_e value in the formatter, such as I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE.

Typedefs

typedef double i18n_udate
 Date and Time data type.
This is a primitive data type that holds the date and time as the number of milliseconds since 1970-jan-01, 00:00 UTC. UTC leap seconds are ignored.
typedef void * i18n_udate_format_h
 A date formatter.
typedef i18n_ufield_position_si18n_ufield_position_h
 Handle to struct representing a range of text containing a specific field.

Defines

#define I18N_UDATE_YEAR   "y"
 Constant for date skeleton with year.
#define I18N_UDATE_QUARTER   "QQQQ"
 Constant for date skeleton with quarter.
#define I18N_UDATE_ABBR_QUARTER   "QQQ"
 Constant for date skeleton with abbreviated quarter.
#define I18N_UDATE_YEAR_QUARTER   "yQQQQ"
 Constant for date skeleton with year and quarter.
#define I18N_UDATE_YEAR_ABBR_QUARTER   "yQQQ"
 Constant for date skeleton with year and abbreviated quarter.
#define I18N_UDATE_MONTH   "MMMM"
 Constant for date skeleton with month.
#define I18N_UDATE_ABBR_MONTH   "MMM"
 Constant for date skeleton with abbreviated month.
#define I18N_UDATE_NUM_MONTH   "M"
 Constant for date skeleton with numeric month.
#define I18N_UDATE_YEAR_MONTH   "yMMMM"
 Constant for date skeleton with year and month.
#define I18N_UDATE_YEAR_ABBR_MONTH   "yMMM"
 Constant for date skeleton with year and abbreviated month.
#define I18N_UDATE_YEAR_NUM_MONTH   "yM"
 Constant for date skeleton with year and numeric month.
#define I18N_UDATE_DAY   "d"
 Constant for date skeleton with day.
#define I18N_UDATE_YEAR_MONTH_DAY   "yMMMMd"
 Constant for date skeleton with year, month, and day.
#define I18N_UDATE_YEAR_ABBR_MONTH_DAY   "yMMMd"
 Constant for date skeleton with year, abbreviated month, and day.
#define I18N_UDATE_YEAR_NUM_MONTH_DAY   "yMd"
 Constant for date skeleton with year, numeric month, and day.
#define I18N_UDATE_WEEKDAY   "EEEE"
 Constant for date skeleton with weekday.
#define I18N_UDATE_ABBR_WEEKDAY   "E"
 Constant for date skeleton with abbreviated weekday.
#define I18N_UDATE_YEAR_MONTH_WEEKDAY_DAY   "yMMMMEEEEd"
 Constant for date skeleton with year, month, weekday, and day.
#define I18N_UDATE_YEAR_ABBR_MONTH_WEEKDAY_DAY   "yMMMEd"
 Constant for date skeleton with year, abbreviated month, weekday, and day.
#define I18N_UDATE_YEAR_NUM_MONTH_WEEKDAY_DAY   "yMEd"
 Constant for date skeleton with year, numeric month, weekday, and day.
#define I18N_UDATE_MONTH_DAY   "MMMMd"
 Constant for date skeleton with long month and day.
#define I18N_UDATE_ABBR_MONTH_DAY   "MMMd"
 Constant for date skeleton with abbreviated month and day.
#define I18N_UDATE_NUM_MONTH_DAY   "Md"
 Constant for date skeleton with numeric month and day.
#define I18N_UDATE_MONTH_WEEKDAY_DAY   "MMMMEEEEd"
 Constant for date skeleton with month, weekday, and day.
#define I18N_UDATE_ABBR_MONTH_WEEKDAY_DAY   "MMMEd"
 Constant for date skeleton with abbreviated month, weekday, and day.
#define I18N_UDATE_NUM_MONTH_WEEKDAY_DAY   "MEd"
 Constant for date skeleton with numeric month, weekday, and day.
#define I18N_UDATE_HOUR   "j"
 Constant for date skeleton with hour, with the locale's preferred hour format (12 or 24).
#define I18N_UDATE_HOUR24   "H"
 Constant for date skeleton with hour in 24-hour presentation.
#define I18N_UDATE_MINUTE   "m"
 Constant for date skeleton with minute.
#define I18N_UDATE_HOUR_MINUTE   "jm"
 Constant for date skeleton with hour and minute, with the locale's preferred hour format (12 or 24).
#define I18N_UDATE_HOUR24_MINUTE   "Hm"
 Constant for date skeleton with hour and minute in 24-hour presentation.
#define I18N_UDATE_SECOND   "s"
 Constant for date skeleton with second.
#define I18N_UDATE_HOUR_MINUTE_SECOND   "jms"
 Constant for date skeleton with hour, minute, and second, with the locale's preferred hour format (12 or 24).
#define I18N_UDATE_HOUR24_MINUTE_SECOND   "Hms"
 Constant for date skeleton with hour, minute, and second in 24-hour presentation.
#define I18N_UDATE_MINUTE_SECOND   "ms"
 Constant for date skeleton with minute and second.

Define Documentation

#define I18N_UDATE_ABBR_MONTH   "MMM"

Constant for date skeleton with abbreviated month.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_ABBR_MONTH_DAY   "MMMd"

Constant for date skeleton with abbreviated month and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_ABBR_MONTH_WEEKDAY_DAY   "MMMEd"

Constant for date skeleton with abbreviated month, weekday, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_ABBR_QUARTER   "QQQ"

Constant for date skeleton with abbreviated quarter.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_ABBR_WEEKDAY   "E"

Constant for date skeleton with abbreviated weekday.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_DAY   "d"

Constant for date skeleton with day.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_HOUR   "j"

Constant for date skeleton with hour, with the locale's preferred hour format (12 or 24).

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_HOUR24   "H"

Constant for date skeleton with hour in 24-hour presentation.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_HOUR24_MINUTE   "Hm"

Constant for date skeleton with hour and minute in 24-hour presentation.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_HOUR24_MINUTE_SECOND   "Hms"

Constant for date skeleton with hour, minute, and second in 24-hour presentation.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_HOUR_MINUTE   "jm"

Constant for date skeleton with hour and minute, with the locale's preferred hour format (12 or 24).

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_HOUR_MINUTE_SECOND   "jms"

Constant for date skeleton with hour, minute, and second, with the locale's preferred hour format (12 or 24).

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_MINUTE   "m"

Constant for date skeleton with minute.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_MINUTE_SECOND   "ms"

Constant for date skeleton with minute and second.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_MONTH   "MMMM"

Constant for date skeleton with month.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_MONTH_DAY   "MMMMd"

Constant for date skeleton with long month and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_MONTH_WEEKDAY_DAY   "MMMMEEEEd"

Constant for date skeleton with month, weekday, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_NUM_MONTH   "M"

Constant for date skeleton with numeric month.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_NUM_MONTH_DAY   "Md"

Constant for date skeleton with numeric month and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()

Constant for date skeleton with numeric month, weekday, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_QUARTER   "QQQQ"

Constant for date skeleton with quarter.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_SECOND   "s"

Constant for date skeleton with second.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_WEEKDAY   "EEEE"

Constant for date skeleton with weekday.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR   "y"

Constant for date skeleton with year.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_ABBR_MONTH   "yMMM"

Constant for date skeleton with year and abbreviated month.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_ABBR_MONTH_DAY   "yMMMd"

Constant for date skeleton with year, abbreviated month, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()

Constant for date skeleton with year, abbreviated month, weekday, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_ABBR_QUARTER   "yQQQ"

Constant for date skeleton with year and abbreviated quarter.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_MONTH   "yMMMM"

Constant for date skeleton with year and month.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_MONTH_DAY   "yMMMMd"

Constant for date skeleton with year, month, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_MONTH_WEEKDAY_DAY   "yMMMMEEEEd"

Constant for date skeleton with year, month, weekday, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_NUM_MONTH   "yM"

Constant for date skeleton with year and numeric month.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_NUM_MONTH_DAY   "yMd"

Constant for date skeleton with year, numeric month, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()

Constant for date skeleton with year, numeric month, weekday, and day.

Used in combinations date + time, date + time + zone, or time + zone.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()
#define I18N_UDATE_YEAR_QUARTER   "yQQQQ"

Constant for date skeleton with year and quarter.

Since :
3.0
See also:
i18n_udatepg_get_best_pattern()

Typedef Documentation

typedef double i18n_udate

Date and Time data type.
This is a primitive data type that holds the date and time as the number of milliseconds since 1970-jan-01, 00:00 UTC. UTC leap seconds are ignored.

Date and Time data type.

This is a primitive data type that holds the date and time as the number of milliseconds since 1970-jan-01, 00:00 UTC. UTC leap seconds are ignored.

Since :
2.3
typedef void* i18n_udate_format_h

A date formatter.

Since :
2.3

Handle to struct representing a range of text containing a specific field.

Since :
2.3

Enumeration Type Documentation

Enumeration for format fields.

Since :
2.3.1
Enumerator:
I18N_UDATE_FORMAT_ERA_FIELD 

Era field

I18N_UDATE_FORMAT_YEAR_FIELD 

Year field

I18N_UDATE_FORMAT_MONTH_FIELD 

Month field

I18N_UDATE_FORMAT_DATE_FIELD 

Date field

I18N_UDATE_FORMAT_HOUR_OF_DAY1_FIELD 

Hour of day1 field

I18N_UDATE_FORMAT_HOUR_OF_DAY0_FIELD 

Hour of day0 field

I18N_UDATE_FORMAT_MINUTE_FIELD 

Minute field

I18N_UDATE_FORMAT_SECOND_FIELD 

Second field

I18N_UDATE_FORMAT_FRACTIONAL_SECOND_FIELD 

Fractional second field

I18N_UDATE_FORMAT_DAY_OF_WEEK_FIELD 

Day of week field

I18N_UDATE_FORMAT_DAY_OF_YEAR_FIELD 

Day of year field

I18N_UDATE_FORMAT_DAY_OF_WEEK_IN_MONTH_FIELD 

Day of week in month field

I18N_UDATE_FORMAT_WEEK_OF_YEAR_FIELD 

Week of year field

I18N_UDATE_FORMAT_WEEK_OF_MONTH_FIELD 

Week of month field

I18N_UDATE_FORMAT_AM_PM_FIELD 

a.m. / p.m. field

I18N_UDATE_FORMAT_HOUR1_FIELD 

Hour1 field

I18N_UDATE_FORMAT_HOUR0_FIELD 

Hour0 field

I18N_UDATE_FORMAT_TIMEZONE_FIELD 

Timezone field

I18N_UDATE_FORMAT_YEAR_WOY_FIELD 

Year woy field

I18N_UDATE_FORMAT_DOW_LOCAL_FIELD 

Dow local field

I18N_UDATE_FORMAT_EXTENDED_YEAR_FIELD 

Extended year field

I18N_UDATE_FORMAT_JULIAN_DAY_FIELD 

Julian day field

I18N_UDATE_FORMAT_MILLISECONDS_IN_DAY_FIELD 

Milliseconds in day field

I18N_UDATE_FORMAT_TIMEZONE_RFC_FIELD 

Timezone RFC field

I18N_UDATE_FORMAT_TIMEZONE_GENERIC_FIELD 

Timezone generic field

I18N_UDATE_FORMAT_STANDALONE_DAY_FIELD 

Standalone day field

I18N_UDATE_FORMAT_STANDALONE_MONTH_FIELD 

Standalone month field

I18N_UDATE_FORMAT_QUARTER_FIELD 

Quarter field

I18N_UDATE_FORMAT_STANDALONE_QUARTER_FIELD 

Standalone quarter field

I18N_UDATE_FORMAT_TIMEZONE_SPECIAL_FIELD 

Timezone special field

I18N_UDATE_FORMAT_YEAR_NAME_FIELD 

Year name field

I18N_UDATE_FORMAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD 

Timezone localized gmt offset field

I18N_UDATE_FORMAT_TIMEZONE_ISO_FIELD 

Timezone ISO field

I18N_UDATE_FORMAT_TIMEZONE_ISO_LOCAL_FIELD 

Timezone ISO local field

I18N_UDATE_FORMAT_FIELD_COUNT 

Field count

Enumeration for the possible date/time format styles.

Since :
2.3
Enumerator:
I18N_UDATE_FULL 

Full style

I18N_UDATE_LONG 

Long style

I18N_UDATE_MEDIUM 

Medium style

I18N_UDATE_SHORT 

Short style

I18N_UDATE_DEFAULT 

Default style

I18N_UDATE_RELATIVE 

Bitfield for relative date

I18N_UDATE_FULL_RELATIVE 

I18N_UDATE_FULL | I18N_UDATE_RELATIVE

I18N_UDATE_LONG_RELATIVE 

I18N_UDATE_LONG | I18N_UDATE_RELATIVE

I18N_UDATE_MEDIUM_RELATIVE 

I18N_UDATE_MEDIUM | I18N_UDATE_RELATIVE

I18N_UDATE_SHORT_RELATIVE 

I18N_UDATE_SHORT | I18N_UDATE_RELATIVE

I18N_UDATE_NONE 

No style

I18N_UDATE_PATTERN 

Use the pattern given in the parameter to i18n_udate_create().

Enumeration for symbol types.

Since :
2.3.1
Enumerator:
I18N_UDATE_FORMAT_SYMBOL_TYPE_ERAS 

Eras

I18N_UDATE_FORMAT_SYMBOL_TYPE_MONTHS 

Months

I18N_UDATE_FORMAT_SYMBOL_TYPE_SHORT_MONTHS 

Short months

I18N_UDATE_FORMAT_SYMBOL_TYPE_WEEKDAYS 

Weekdays

I18N_UDATE_FORMAT_SYMBOL_TYPE_SHORT_WEEKDAYS 

Short weekdays

I18N_UDATE_FORMAT_SYMBOL_TYPE_AM_PMS 

AM PMs

I18N_UDATE_FORMAT_SYMBOL_TYPE_LOCALIZED_CHARS 

Localized chars

I18N_UDATE_FORMAT_SYMBOL_TYPE_ERA_NAMES 

Era names

I18N_UDATE_FORMAT_SYMBOL_TYPE_NARROW_MONTHS 

Narrow months

I18N_UDATE_FORMAT_SYMBOL_TYPE_NARROW_WEEKDAYS 

Narrow weekdays

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_MONTHS 

Standalone months

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_SHORT_MONTHS 

Standalone short months

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_NARROW_MONTHS 

Standalone narrow months

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_WEEKDAYS 

Standalone weekdays

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_SHORT_WEEKDAYS 

Standalone short weekdays

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_NARROW_WEEKDAYS 

Standalone narrow weekdays

I18N_UDATE_FORMAT_SYMBOL_TYPE_QUARTERS 

Quarters

I18N_UDATE_FORMAT_SYMBOL_TYPE_SHORT_QUARTERS 

Short quarters

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_QUARTERS 

Standalone quarters

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_SHORT_QUARTERS 

Standalone short quarters

I18N_UDATE_FORMAT_SYMBOL_TYPE_SHORTER_WEEKDAYS 

Shorter weekdays

I18N_UDATE_FORMAT_SYMBOL_TYPE_STANDALONE_SHORTER_WEEKDAYS 

Standalone shorter weekdays

Enumeration for display context.

Since :
2.3.1
Enumerator:
I18N_UDISPLAY_CONTEXT_STANDARD_NAMES 

Standard names

I18N_UDISPLAY_CONTEXT_DIALECT_NAMES 

Dialect names

I18N_UDISPLAY_CONTEXT_CAPITALIZATION_NONE 

Capitalization: None

I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE 

Capitalization: For middle of sentence

I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE 

Capitalization: For beginning of sentence

I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_UI_LIST_OR_MENU 

Capitalization: For UI list or menu

I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE 

Capitalization: For standalone

Display context types, for getting values of a particular setting.

Note, the specific numeric values are internal and may change.

Since :
2.3.1
Enumerator:
I18N_UDISPCTX_TYPE_DIALECT_HANDLING 

Type to retrieve the dialect handling setting, e.g. UDISPCTX_STANDARD_NAMES or UDISPCTX_DIALECT_NAMES.

I18N_UDISPCTX_TYPE_CAPITALIZATION 

Type to retrieve the capitalization context setting, e.g. UDISPCTX_CAPITALIZATION_NONE, UDISPCTX_CAPITALIZATION_FOR_MIDDLE_OF_SENTENCE, UDISPCTX_CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE, etc.

I18N_UDISPCTX_TYPE_DISPLAY_LENGTH 

Type to retrieve the display length setting, e.g. UDISPCTX_LENGTH_FULL, UDISPCTX_LENGTH_SHORT.


Function Documentation

int i18n_udate_apply_pattern ( i18n_udate_format_h  format,
i18n_ubool  localized,
const i18n_uchar pattern,
int32_t  pattern_length 
)

Sets the pattern used by an i18n_udate_format_h.

The pattern should follow the pattern syntax rules.

Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to set.
[in]localizedtrue if the pattern is localized, false otherwise.
[in]patternThe new pattern.
[in]pattern_lengthThe length of pattern, or -1 if NULL-terminated.
Returns:
Error code.
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_to_pattern()
int i18n_udate_clone ( const i18n_udate_format_h  format,
i18n_udate_format_h format_clone 
)

Creates a copy of an i18n_udate_format_h.

This function performs a deep copy.

Since :
2.3.1
Remarks:
The format_clone should be released using i18n_udate_destroy().
Parameters:
[in]formatThe format to copy.
[out]format_cloneA pointer to clone of format.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
 #include <stdio.h>
 #include <stdlib.h>
 #include <utils_i18n.h>
 int main() {
    i18n_error_code_e error_code;
    i18n_udate_format_h format = NULL;
    i18n_udate_format_style_e time_style = I18N_UDATE_DEFAULT, date_style = I18N_UDATE_DEFAULT;
    const char *locale = I18N_ULOCALE_US;
    const i18n_uchar *tz_id = 0; // use the default timezone
    int32_t tz_id_length = -1;
    const i18n_uchar *pattern = NULL;
    int32_t pattern_length = 0;
    i18n_udate_format_h format_clone = NULL;

    error_code = i18n_udate_create(time_style, date_style, locale, tz_id, tz_id_length, pattern, pattern_length, &format);
    if(error_code != I18N_ERROR_NONE) {
        printf("Error i18n_udate_create: %d\n", error_code);
        return EXIT_FAILURE;
    }

    error_code = i18n_udate_clone(format, &format_clone);
    if(error_code != I18N_ERROR_NONE) {
        printf("Error i18n_udate_clone : %d\n", error_code);
        i18n_udate_destroy(format);
        return EXIT_FAILURE;
    }
    i18n_udate_destroy(format_clone);
    i18n_udate_destroy(format);
    return EXIT_SUCCESS;
 }
int32_t i18n_udate_count_available ( void  )

Determines how many locales have date/time formatting patterns available.

This function is the most useful for determining the loop ending condition for calls to i18n_udate_get_available().

Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exceptions section.
Since :
2.3.1
Returns:
The number of locales for which date/time formatting patterns are available.
Exceptions:
I18N_ERROR_NONESuccessful
See also:
i18n_udate_get_available()

Counts the number of particular symbols for an i18n_udate_format_h.

This function is most useful for determining the loop termination condition for calls to i18n_udate_get_symbols().

Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exceptions section.
Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to query.
[in]typeThe type of symbols to count. If wrong type is passed, 0 will be returned.
Returns:
The number of symbols of type type.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_get_symbols()
i18n_udate_set_symbols()
int i18n_udate_create ( i18n_udate_format_style_e  time_style,
i18n_udate_format_style_e  date_style,
const char *  locale,
const i18n_uchar tz_id,
int32_t  tz_id_len,
const i18n_uchar pattern,
int  pattern_len,
i18n_udate_format_h format 
)

Creates a new i18n_udate_format_h for formatting and parsing dates and times.

A i18n_udate_format_h may be used to format dates in calls to i18n_udate_create().

Since :
2.3
Remarks:
Must release format using i18n_udate_destroy().
If pattern parameter is used, pass in I18N_UDATE_PATTERN for time_style and date_style.
I18N_UDATE_PATTERN can only be used in this case, and has to be set for both time_style and date_style.
Parameters:
[in]time_styleThe style used to format times
One of I18N_UDATE_FULL, I18N_UDATE_LONG, I18N_UDATE_MEDIUM, I18N_UDATE_SHORT, I18N_UDATE_DEFAULT, I18N_UDATE_PATTERN (see remarks) or I18N_UDATE_NONE (relative time styles are not currently supported).
[in]date_styleThe style used to format dates
One of I18N_UDATE_FULL, I18N_UDATE_LONG, I18N_UDATE_MEDIUM, I18N_UDATE_SHORT, I18N_UDATE_DEFAULT, I18N_UDATE_RELATIVE, I18N_UDATE_LONG_RELATIVE, I18N_UDATE_MEDIUM_RELATIVE, I18N_UDATE_SHORT_RELATIVE, I18N_UDATE_PATTERN (see remarks) or I18N_UDATE_NONE
[in]localeThe locale specifying the formatting conventions.
[in]tz_idA timezone ID specifying the timezone to use
If 0, use the default timezone.
[in]tz_id_lenThe length of tz_id, otherwise -1 if NULL-terminated.
[in]patternA pattern specifying the format to use. The pattern is generated by Udatepg module.
When the pattern parameter is used, pass in I18N_UDATE_PATTERN for both time_style and date_style.
See remarks for additional conditions.
[in]pattern_lenThe number of characters in the pattern, or otherwise -1 if NULL-terminated.
[out]formatA pointer to an i18n_udate_format_h to use for formatting dates and times, otherwise 0 if an error occurs.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter

Destroys an i18n_udate_format_h.

Once destroyed, an i18n_udate_format_h may no longer be used.

Since :
2.3
Parameters:
[in]formatThe formatter to destroy.
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_udate_format_date ( const i18n_udate_format_h  format,
i18n_udate  date_to_format,
i18n_uchar result,
int32_t  result_len,
i18n_ufield_position_h  pos,
int32_t *  buf_size_needed 
)

Formats a date using an i18n_udate_format_h.

The date will be formatted using the conventions specified in i18n_udate_create()

Since :
2.3
Parameters:
[in]formatThe formatter to use.
[in]date_to_formatThe date to format.
[out]resultA pointer to a buffer to receive the formatted number.
[in]result_lenThe maximum size of the result.
[in]posA pointer to an i18n_ufield_position
On input, position->field is read
On output, position->beginIndex and position->endIndex indicate the beginning and ending indices of field number position->field, if such a field exists
This parameter may be NULL, in which case no field position data is returned.
[out]buf_size_neededThe total buffer size needed
If greater than result_len, the output was truncated.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter

Gets the year relative to which all 2-digit years are interpreted.

For example, if the 2-digit start year is 2100, the year 99 will be interpreted as 2199.

Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to get.
[out]yearA pointer to the year relative to which all 2-digit years are interpreted.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_set_2digit_year_start()
const char* i18n_udate_get_available ( int32_t  locale_index)

Gets a locale for which date/time formatting patterns are available.

An i18n_udate_format_h in a locale returned by this function will perform the correct formatting and parsing for the locale.

Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exceptions section.
Since :
2.3.1
Parameters:
[in]locale_indexThe index of the desired locale.
Returns:
A locale for which date/time formatting patterns are available, or 0 if none.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_count_available()
int i18n_udate_get_calendar ( const i18n_udate_format_h  format,
i18n_ucalendar_h calendar 
)

Gets the i18n_ucalendar_h associated with an i18n_udate_format_h.

An i18n_udate_format_h uses an i18n_ucalendar_h to convert a raw value to, for example, the day of the week.

Since :
2.3.1
Remarks:
The calendar should not be released.
Parameters:
[in]formatThe i18n_udate_format_h to query.
[out]calendarA pointer to the i18n_ucalendar_h used by format.
Returns:
Error code.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_set_calendar()

Gets the locale for this date format object.

You can choose between valid and actual locale.

Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exceptions section and i18n_error_code_e description.
Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to get the locale from.
[in]typeThe type of the locale we're looking for (valid or actual).
Returns:
The locale name.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_udate_get_number_format ( const i18n_udate_format_h  format,
i18n_unumber_format_h number_format 
)

Gets the i18n_unumber_format_h associated with an i18n_udate_format_h.

An i18n_udate_format_h uses an i18n_unumber_format_h to format numbers within a date, for example the day number.

Since :
2.3.1
Remarks:
The number_format should not be released.
Parameters:
[in]formatThe formatter to query.
[out]number_formatA pointer to the i18n_unumber_format_h used by format to format numbers.
Returns:
Error code.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_set_number_format()
int32_t i18n_udate_get_symbols ( const i18n_udate_format_h  format,
i18n_udate_format_symbol_type_e  type,
int32_t  symbol_index,
i18n_uchar result,
int32_t  result_length 
)

Gets the symbols associated with an i18n_udate_format_h.

The symbols are what an i18n_udate_format_h uses to represent locale-specific data, for example month or day names.

Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exceptions section and i18n_error_code_e description.
Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to query.
[in]typeThe type of symbols to get. All the types defined in the i18n_udate_format_symbol_type_e enumeration are supported.
[in]symbol_indexThe desired symbol of type type.
[out]resultA pointer to a buffer to receive the pattern.
[in]result_lengthThe maximum size of the result buffer.
Returns:
The total buffer size needed; if greater than result_length, the output was truncated.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_count_symbols()
i18n_udate_set_symbols()

Determines if an i18n_udate_format_h will perform lenient parsing.

With lenient parsing, the parser may use heuristics to interpret inputs that do not precisely match the pattern. With strict parsing, inputs must match the pattern.

Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exceptions section.
Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to query.
Returns:
true if format is set to perform lenient parsing, false otherwise.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_set_lenient()
int i18n_udate_parse ( const i18n_udate_format_h  format,
const i18n_uchar text,
int32_t  text_length,
int32_t *  parse_pos,
i18n_udate parsed_date 
)

Parses a string into an date/time using an i18n_udate_format_h.

The date will be parsed using the conventions specified in i18n_udate_create().
Note that the normal date formats associated with some calendars - such as the Chinese lunar calendar - do not specify enough fields to enable dates to be parsed unambiguously. In the case of the Chinese lunar calendar, while the year within the current 60-year cycle is specified, the number of such cycles since the start date of the calendar (in the I18N_UCALENDAR_ERA field of the i18n_ucalendar_h) is not normally part of the format, and parsing may assume the wrong era. For such cases it is recommended that clients parse using i18n_udate_parse_calendar() with the calendar passed in set to the current date, or to a date within the era/cycle that should be assumed if absent in the format.

Since :
2.3.1
Parameters:
[in]formatThe formatter to use.
[in]textThe text to parse.
[in]text_lengthThe length of text, or -1 if NULL-terminated.
[in]parse_posIf not 0, on input a pointer to an integer specifying the offset at which to begin parsing. If not 0, on output the offset at which parsing ended.
[out]parsed_dateA pointer to the value of the parsed date/time.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_format_date()
int i18n_udate_parse_calendar ( const i18n_udate_format_h  format,
i18n_ucalendar_h calendar,
const i18n_uchar text,
int32_t  text_length,
int32_t *  parse_pos 
)

Parses a string into an date/time using an i18n_udate_format_h.

The date will be parsed using the conventions specified in i18n_udate_create().

Since :
2.3.1
Parameters:
[in]formatThe formatter to use.
[in,out]calendarA pointer to calendar set on input to the date and time to be used for missing values in the date/time string being parsed, and set on output to the parsed date/time. When the calendar type is different from the internal calendar held by the i18n_udate_format_h instance, the internal calendar will be cloned to a work calendar set to the same milliseconds and time zone as this calendar parameter, field values will be parsed based on the work calendar, then the result (milliseconds and time zone) will be set in this calendar.
[in]textThe text to parse.
[in]text_lengthThe length of text, or -1 if NULL-terminated.
[in]parse_posIf not 0, on input a pointer to an integer specifying the offset at which to begin parsing. If not 0, on output the offset at which parsing ended.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_format_date()

Sets the year relative to which all 2-digit years will be interpreted.

For example, if the 2-digit start year is 2100, the year 99 will be interpreted as 2199.

Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to map.
[in]dateThe year relative to which all 2-digit years will be interpreted.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_get_2digit_year_start()
int i18n_udate_set_calendar ( i18n_udate_format_h  format,
const i18n_ucalendar_h  calendar_to_set 
)

Sets the i18n_ucalendar_h associated with an i18n_udate_format_h.

An i18n_udate_format_h uses an i18n_ucalendar_h to convert a raw value to, for example, the day of the week.

Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h.
[in]calendar_to_setAn i18n_ucalendar_h to be used by the format.
Returns:
Error code.
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_get_calendar()

Sets a particular i18n_udisplay_context_e value in the formatter, such as I18N_UDISPLAY_CONTEXT_CAPITALIZATION_FOR_STANDALONE.

Remarks:
I18N_UDISPLAY_CONTEXT_STANDARD_NAMES and I18N_UDISPLAY_CONTEXT_DIALECT_NAMES are not supported.
Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to set a i18n_udisplay_context_e value.
[in]valueThe i18n_udisplay_context_e value to set.
Returns:
Error code. Error codes not listed below are described in i18n_error_code_e
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int i18n_udate_set_lenient ( i18n_udate_format_h  format,
i18n_ubool  is_lenient 
)

Specifies whether an i18n_udate_format_h will perform lenient parsing.

With lenient parsing, the parser may use heuristics to interpret inputs that do not precisely match the pattern. With strict parsing, inputs must match the pattern.

Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to set.
[in]is_lenienttrue if fmt should perform lenient parsing, false otherwise.
Returns:
Error code.
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_is_lenient()
int i18n_udate_set_number_format ( i18n_udate_format_h  format,
const i18n_unumber_format_h  number_format_to_set 
)

Sets the i18n_unumber_format_h associated with an i18n_udate_format_h.

An i18n_udate_format_h uses an i18n_unumber_format_h to format numbers within a date, for example the day number.

Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to set.
[in]number_format_to_setAn i18n_unumber_format_h to be used by format to format numbers.
Returns:
Error code.
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_get_number_format()
int i18n_udate_set_symbols ( i18n_udate_format_h  format,
i18n_udate_format_symbol_type_e  type,
int32_t  symbol_index,
i18n_uchar value,
int32_t  value_length 
)

Sets the symbols associated with an i18n_udate_format_h.

The symbols are what an i18n_udate_format_h uses to represent locale-specific data, for example month or day names.

Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to set.
[in]typeThe type of symbols to set. All the types defined in the i18n_udate_format_symbol_type_e enumeration are supported. If a type not defined in the enumeration is passed, then the I18N_ERROR_NOT_SUPPORTED error is returned.
[in]symbol_indexThe index of the symbol to set of type type.
[in]valueThe new value.
[in]value_lengthThe length of value, or -1 if NULL-terminated.
Returns:
Error code. Error codes not listed below are described in the i18n_error_code_e enumeration.
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_count_symbols()
i18n_udate_get_symbols()

Maps from an i18n_udate_format_h to the corresponding i18n_ucalendar_date_fields_e.

Note: since the mapping is many-to-one, there is no inverse mapping.

Since :
2.3.1
Parameters:
[in]fieldThe i18n_udate_format_h to map. I18N_UDATE_FORMAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD, I18N_UDATE_FORMAT_TIMEZONE_ISO_FIELD, I18N_UDATE_FORMAT_TIMEZONE_ISO_LOCAL_FIELD and I18N_UDATE_FORMAT_FIELD_COUNT are not supported.
[out]date_field_typeA pointer to the i18n_ucalendar_date_fields_e.
Returns:
Error code.
Return values:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
int32_t i18n_udate_to_pattern ( const i18n_udate_format_h  format,
i18n_ubool  localized,
i18n_uchar result,
int32_t  result_length 
)

Extracts the pattern from an i18n_udate_format_h.

The pattern will follow the pattern syntax rules.

Remarks:
The specific error code can be obtained using the get_last_result() method. Error codes are described in Exceptions section and i18n_error_code_e description.
Since :
2.3.1
Parameters:
[in]formatThe i18n_udate_format_h to query.
[in]localizedtrue if the pattern should be localized, false otherwise.
[out]resultA pointer to a buffer to receive the pattern.
[in]result_lengthThe maximum size of result.
Returns:
The total buffer size needed; if greater than result_length, the output was truncated.
Exceptions:
I18N_ERROR_NONESuccessful
I18N_ERROR_INVALID_PARAMETERInvalid function parameter
See also:
i18n_udate_apply_pattern()