14ee2ad04344446e610172a0e73949212923014dfSebastian Redl/* 22cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor ******************************************************************************* 32cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Copyright (C) 1996-2013, International Business Machines 42cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Corporation and others. All Rights Reserved. 52cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor ******************************************************************************* 62cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor*/ 72cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 82cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#ifndef UDAT_H 92cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define UDAT_H 10a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl 112cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#include "unicode/utypes.h" 122cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 132cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#if !UCONFIG_NO_FORMATTING 147faa2ec03a7ef120ac165bb45b6c70a8b20c9f1cSebastian Redl 150eca89e9890db4d8336ce762a5b359a1d58ca02bArgyrios Kyrtzidis#include "unicode/localpointer.h" 16e737f5041a36d0befb39ffeed8d50ba15916d3daDouglas Gregor#include "unicode/ucal.h" 17e737f5041a36d0befb39ffeed8d50ba15916d3daDouglas Gregor#include "unicode/unum.h" 182cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#include "unicode/udisplaycontext.h" 192cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** 202cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * \file 212a7fb27913999d132cf9e10e03dc5271faa2e9d3John McCall * \brief C API: DateFormat 220b7489194f9f89fac39d57211c1e7953ae50251fDouglas Gregor * 237a1fad38256eb4c5129359be85ba1ea1678eb5c9John McCall * <h2> Date Format C API</h2> 242cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * 25a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * Date Format C API consists of functions that convert dates and 266ab7cd853e9c15cf986a8a7c3db1f8d20e275409Sebastian Redl * times from their internal representations to textual form and back again in a 277c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner * language-independent manner. Converting from the internal representation (milliseconds 286a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * since midnight, January 1, 1970) to text is known as "formatting," and converting 297c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner * from text to millis is known as "parsing." We currently define only one concrete 3083d63c78810556d26b62ac4cbae2eda6cdd2570cSteve Naroff * structure UDateFormat, which can handle pretty much all normal 3114f79002e58556798e86168c63e48d533287eda5Douglas Gregor * date formatting and parsing actions. 323251ceb90b3fec68e86d6dcfa58836e20a7205c3Douglas Gregor * <P> 3314f79002e58556798e86168c63e48d533287eda5Douglas Gregor * Date Format helps you to format and parse dates for any locale. Your code can 34bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregor * be completely independent of the locale conventions for months, days of the 352bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor * week, or even the calendar format: lunar vs. solar. 36ab41e63821dc60ad144d0684df8d79a9eef86b75Douglas Gregor * <P> 3717fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregor * To format a date for the current Locale with default time and date style, 3817fc223395d51be582fc666bb6ea21bd1dff26dcDouglas Gregor * use one of the static factory methods: 392596e429a61602312bdd149786045b8a90cd2d10Daniel Dunbar * <pre> 402cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * \code 4114f79002e58556798e86168c63e48d533287eda5Douglas Gregor * UErrorCode status = U_ZERO_ERROR; 42b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * UChar *myString; 433c304bd9ec2b4611572d4cbae9e1727bbecb5dc9Chris Lattner * int32_t myStrlen = 0; 442cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UDateFormat* dfmt = udat_open(UDAT_DEFAULT, UDAT_DEFAULT, NULL, NULL, -1, NULL, -1, &status); 458538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * myStrlen = udat_format(dfmt, myDate, NULL, myStrlen, NULL, &status); 462cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * if (status==U_BUFFER_OVERFLOW_ERROR){ 47ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * status=U_ZERO_ERROR; 48ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * myString=(UChar*)malloc(sizeof(UChar) * (myStrlen+1) ); 49ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * udat_format(dfmt, myDate, myString, myStrlen+1, NULL, &status); 50ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * } 51ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * \endcode 52ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * </pre> 53ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * If you are formatting multiple numbers, it is more efficient to get the 54ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * format and use it multiple times so that the system doesn't have to fetch the 55ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl * information about the local language and country conventions multiple times. 562cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <pre> 572cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * \code 582cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UErrorCode status = U_ZERO_ERROR; 5912b1c7615d4f9a2edc544be499f895f16ac100edChris Lattner * int32_t i, myStrlen = 0; 602cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UChar* myString; 613397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * char buffer[1024]; 62a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl * UDate myDateArr[] = { 0.0, 100000000.0, 2000000000.0 }; // test values 63a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl * UDateFormat* df = udat_open(UDAT_DEFAULT, UDAT_DEFAULT, NULL, NULL, -1, NULL, 0, &status); 642cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * for (i = 0; i < 3; i++) { 652cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * myStrlen = udat_format(df, myDateArr[i], NULL, myStrlen, NULL, &status); 662cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * if(status == U_BUFFER_OVERFLOW_ERROR){ 678538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * status = U_ZERO_ERROR; 682cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * myString = (UChar*)malloc(sizeof(UChar) * (myStrlen+1) ); 693397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * udat_format(df, myDateArr[i], myString, myStrlen+1, NULL, &status); 708538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * printf("%s\n", u_austrcpy(buffer, myString) ); 712cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * free(myString); 722cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * } 732cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * } 742cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * \endcode 752cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * </pre> 762cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * To get specific fields of a date, you can use UFieldPosition to 772cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * get specific fields. 782cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <pre> 792cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * \code 802cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UErrorCode status = U_ZERO_ERROR; 812cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UFieldPosition pos; 823397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * UChar *myString; 832cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * int32_t myStrlen = 0; 842cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * char buffer[1024]; 852cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * 863397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * pos.field = 1; // Same as the DateFormat::EField enum 872cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UDateFormat* dfmt = udat_open(UDAT_DEFAULT, UDAT_DEFAULT, NULL, -1, NULL, 0, &status); 888538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * myStrlen = udat_format(dfmt, myDate, NULL, myStrlen, &pos, &status); 892cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * if (status==U_BUFFER_OVERFLOW_ERROR){ 902cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * status=U_ZERO_ERROR; 913397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * myString=(UChar*)malloc(sizeof(UChar) * (myStrlen+1) ); 922cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * udat_format(dfmt, myDate, myString, myStrlen+1, &pos, &status); 938538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * } 942cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * printf("date format: %s\n", u_austrcpy(buffer, myString)); 952cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * buffer[pos.endIndex] = 0; // NULL terminate the string. 963397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * printf("UFieldPosition position equals %s\n", &buffer[pos.beginIndex]); 971eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * \endcode 988538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * </pre> 992cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * To format a date for a different Locale, specify it in the call to 1002cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * udat_open() 1013397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * <pre> 1022cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * \code 1038538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * UDateFormat* df = udat_open(UDAT_SHORT, UDAT_SHORT, "fr_FR", NULL, -1, NULL, 0, &status); 1042cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * \endcode 1052cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * </pre> 1063397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * You can use a DateFormat API udat_parse() to parse. 1072cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <pre> 1088538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * \code 1092cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UErrorCode status = U_ZERO_ERROR; 1102cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * int32_t parsepos=0; 1113397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * UDate myDate = udat_parse(df, myString, u_strlen(myString), &parsepos, &status); 1121eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * \endcode 1131eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * </pre> 1148538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * You can pass in different options for the arguments for date and time style 1152cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * to control the length of the result; from SHORT to MEDIUM to LONG to FULL. 1162cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * The exact result depends on the locale, but generally: 1173397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * see UDateFormatStyle for more details 1182cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <ul type=round> 1192cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <li> UDAT_SHORT is completely numeric, such as 12/13/52 or 3:30pm 1200953e767ff7817f97b3ab20896b229891eeff45bJohn McCall * <li> UDAT_MEDIUM is longer, such as Jan 12, 1952 1212cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <li> UDAT_LONG is longer, such as January 12, 1952 or 3:30:32pm 1222cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <li> UDAT_FULL is pretty completely specified, such as 1233397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * Tuesday, April 12, 1952 AD or 3:30:42pm PST. 1242cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * </ul> 1252cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * You can also set the time zone on the format if you wish. 1268538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * <P> 1272cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * You can also use forms of the parse and format methods with Parse Position and 1282cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * UFieldPosition to allow you to 1293397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * <ul type=round> 1302cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <li> Progressively parse through pieces of a string. 1318538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * <li> Align any particular field, or find out where it is for selection 1322cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * on the screen. 1332cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * </ul> 1343397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * <p><strong>Date and Time Patterns:</strong></p> 1352cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * 1367e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * <p>Date and time formats are specified by <em>date and time pattern</em> strings. 1377e7eb3da052a6d80ddf2377cab0384c798f73f75Douglas Gregor * Within date and time pattern strings, all unquoted ASCII letters [A-Za-z] are reserved 138c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor * as pattern letters representing calendar fields. <code>UDateFormat</code> supports 1398538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * the date and time formatting algorithm and pattern letters defined by 1402cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * <a href="http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table">UTS#35 1412cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Unicode Locale Data Markup Language (LDML)</a> and further documented for ICU in the 1423397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * <a href="https://sites.google.com/site/icuprojectuserguide/formatparse/datetime?pli=1#TOC-Date-Field-Symbol-Table">ICU 1432cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * User Guide</a>.</p> 1442cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 145788b0fd67e1992f23555454efcdb16a19dfefac3Chris Lattner 1468538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl/** A date formatter. 1472cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * For usage in C programs. 1482cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * @stable ICU 2.6 1493397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl */ 1502cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregortypedef void* UDateFormat; 1518538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl 1522cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** The possible date/time format styles 1532cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * @stable ICU 2.6 1543397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl */ 1552cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregortypedef enum UDateFormatStyle { 156264ba48dc98f3f843935a485d5b086f7e0fdc4f1Rafael Espindola /** Full style */ 157264ba48dc98f3f843935a485d5b086f7e0fdc4f1Rafael Espindola UDAT_FULL, 158425ef72306d4ff6b3698b744353e5f0e56b4b884Rafael Espindola /** Long style */ 159ab8bbf4ebd3e3e6eab913cb044772a62b7581941Douglas Gregor UDAT_LONG, 160264ba48dc98f3f843935a485d5b086f7e0fdc4f1Rafael Espindola /** Medium style */ 1612cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor UDAT_MEDIUM, 1622cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /** Short style */ 1633397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl UDAT_SHORT, 1642cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /** Default style */ 1658538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl UDAT_DEFAULT = UDAT_MEDIUM, 1662cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 1672cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /** Bitfield for relative date */ 1683397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl UDAT_RELATIVE = (1 << 7), 1692cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 1702cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor UDAT_FULL_RELATIVE = UDAT_FULL | UDAT_RELATIVE, 1712cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 1722cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor UDAT_LONG_RELATIVE = UDAT_LONG | UDAT_RELATIVE, 1732cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 1742cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor UDAT_MEDIUM_RELATIVE = UDAT_MEDIUM | UDAT_RELATIVE, 175465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl 176465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl UDAT_SHORT_RELATIVE = UDAT_SHORT | UDAT_RELATIVE, 177465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl 178465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl 179465226e23a3008bd68973513dda1f9e3cd27dbddSebastian Redl /** No style */ 1808538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl UDAT_NONE = -1, 1812cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 1822cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /** 1833397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * Use the pattern given in the parameter to udat_open 184ed97649e9574b9d854fa4d6109c9333ae0993554John McCall * @see udat_open 1858538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @stable ICU 50 186ed97649e9574b9d854fa4d6109c9333ae0993554John McCall */ 187ed97649e9574b9d854fa4d6109c9333ae0993554John McCall UDAT_PATTERN = -2, 1883397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl 1892cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor /** @internal alias to UDAT_PATTERN */ 1909763e221e16026ddf487d2564ed349d2c874a1a1Argyrios Kyrtzidis UDAT_IGNORE = UDAT_PATTERN 1919763e221e16026ddf487d2564ed349d2c874a1a1Argyrios Kyrtzidis} UDateFormatStyle; 1928538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl 1932cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/* Skeletons for dates. */ 1942cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 1953397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl/** 196c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor * Constant for date skeleton with year. 1978538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @stable ICU 4.0 1982cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 1992cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define UDAT_YEAR "y" 2003397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#ifndef U_HIDE_DRAFT_API 2012cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** 2028538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Constant for date skeleton with quarter. 2032cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * @draft ICU 51 2042cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 2053397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#define UDAT_QUARTER "QQQQ" 206395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson/** 2078538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Constant for date skeleton with abbreviated quarter. 208395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson * @draft ICU 51 209395b475a4474f1c7574d927ad142ca0c7997cbcaAnders Carlsson */ 2103397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#define UDAT_ABBR_QUARTER "QQQ" 211be191100e034b23a3e13053757a57b7f5068c24aArgyrios Kyrtzidis#endif /* U_HIDE_DRAFT_API */ 2122cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** 2131eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * Constant for date skeleton with year and quarter. 2142cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * @stable ICU 4.0 2152cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 2162cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define UDAT_YEAR_QUARTER "yQQQQ" 2173397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl/** 2182cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Constant for date skeleton with year and abbreviated quarter. 2198538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @stable ICU 4.0 2202cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 2212cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define UDAT_YEAR_ABBR_QUARTER "yQQQ" 2223397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl/** 2232cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Constant for date skeleton with month. 2248538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @stable ICU 4.0 2252cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 2262cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define UDAT_MONTH "MMMM" 2271eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump/** 2283397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * Constant for date skeleton with abbreviated month. 22949a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall * @stable ICU 4.0 23049a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall */ 23149a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall#define UDAT_ABBR_MONTH "MMM" 2328538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl/** 23349a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall * Constant for date skeleton with numeric month. 23449a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall * @stable ICU 4.0 23549a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall */ 2363397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#define UDAT_NUM_MONTH "M" 2372cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** 238be191100e034b23a3e13053757a57b7f5068c24aArgyrios Kyrtzidis * Constant for date skeleton with year and month. 23990b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * @stable ICU 4.0 24090b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis */ 24190b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis#define UDAT_YEAR_MONTH "yMMMM" 24290b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis/** 24390b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * Constant for date skeleton with year and abbreviated month. 2449763e221e16026ddf487d2564ed349d2c874a1a1Argyrios Kyrtzidis * @stable ICU 4.0 2459763e221e16026ddf487d2564ed349d2c874a1a1Argyrios Kyrtzidis */ 2469763e221e16026ddf487d2564ed349d2c874a1a1Argyrios Kyrtzidis#define UDAT_YEAR_ABBR_MONTH "yMMM" 2478538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl/** 24890b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * Constant for date skeleton with year and numeric month. 24990b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * @stable ICU 4.0 25090b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis */ 2513397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#define UDAT_YEAR_NUM_MONTH "yM" 252ae8b17f1d5d303af53db5a4f4a375ea6b9356566Argyrios Kyrtzidis/** 253ae8b17f1d5d303af53db5a4f4a375ea6b9356566Argyrios Kyrtzidis * Constant for date skeleton with day. 254ae8b17f1d5d303af53db5a4f4a375ea6b9356566Argyrios Kyrtzidis * @stable ICU 4.0 2558538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl */ 25690b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis#define UDAT_DAY "d" 25790b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis/** 25890b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * Constant for date skeleton with year, month, and day. 2593397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * Used in combinations date + time, date + time + zone, or time + zone. 26090b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * @stable ICU 4.0 26190b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis */ 26290b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis#define UDAT_YEAR_MONTH_DAY "yMMMMd" 26390b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis/** 26490b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * Constant for date skeleton with year, abbreviated month, and day. 26590b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * Used in combinations date + time, date + time + zone, or time + zone. 2663397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * @stable ICU 4.0 26790b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis */ 26890b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis#define UDAT_YEAR_ABBR_MONTH_DAY "yMMMd" 26990b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis/** 27090b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * Constant for date skeleton with year, numeric month, and day. 2718538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Used in combinations date + time, date + time + zone, or time + zone. 27290b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * @stable ICU 4.0 27390b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis */ 27490b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis#define UDAT_YEAR_NUM_MONTH_DAY "yMd" 2753397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#ifndef U_HIDE_DRAFT_API 2768dfbd8b252ba4e6cf4b7a3422f6ef0ca21312dfeArgyrios Kyrtzidis/** 2778dfbd8b252ba4e6cf4b7a3422f6ef0ca21312dfeArgyrios Kyrtzidis * Constant for date skeleton with weekday. 2788dfbd8b252ba4e6cf4b7a3422f6ef0ca21312dfeArgyrios Kyrtzidis * @draft ICU 51 279f48d45e3e36c132bdee3373beec4e8b19ae3f9c4Argyrios Kyrtzidis */ 280f48d45e3e36c132bdee3373beec4e8b19ae3f9c4Argyrios Kyrtzidis#define UDAT_WEEKDAY "EEEE" 281f48d45e3e36c132bdee3373beec4e8b19ae3f9c4Argyrios Kyrtzidis/** 2828538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Constant for date skeleton with abbreviated weekday. 28390b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis * @draft ICU 51 28490b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis */ 28590b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis#define UDAT_ABBR_WEEKDAY "E" 2863397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#endif /* U_HIDE_DRAFT_API */ 28790b715e0df34eae2b50b9b43ec60828ed31dcf94Argyrios Kyrtzidis/** 2883acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis * Constant for date skeleton with year, month, weekday, and day. 2893acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis * Used in combinations date + time, date + time + zone, or time + zone. 2903acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis * @stable ICU 4.0 2913acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis */ 2923acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis#define UDAT_YEAR_MONTH_WEEKDAY_DAY "yMMMMEEEEd" 2933acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis/** 2943acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis * Constant for date skeleton with year, abbreviated month, weekday, and day. 2958538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Used in combinations date + time, date + time + zone, or time + zone. 2962cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * @stable ICU 4.0 2972cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 2983397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#define UDAT_YEAR_ABBR_MONTH_WEEKDAY_DAY "yMMMEd" 299465d41b92b2c862f3062c412a0538db65c6a2661Abramo Bagnara/** 3003acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis * Constant for date skeleton with year, numeric month, weekday, and day. 3013acad62a239448bef0f5848b2a0d5f7dfefd3d14Argyrios Kyrtzidis * Used in combinations date + time, date + time + zone, or time + zone. 3028538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @stable ICU 4.0 3032cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor */ 3042cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#define UDAT_YEAR_NUM_MONTH_WEEKDAY_DAY "yMEd" 3053397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl/** 3063cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4John McCall * Constant for date skeleton with long month and day. 30731f17ecbef57b5679c017c375db330546b7b5145John McCall * Used in combinations date + time, date + time + zone, or time + zone. 3088538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @stable ICU 4.0 3093cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4John McCall */ 3103cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4John McCall#define UDAT_MONTH_DAY "MMMMd" 3113397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl/** 312deacbdca554298ccdf636f19c6094a8825ec6b34Douglas Gregor * Constant for date skeleton with abbreviated month and day. 3138538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Used in combinations date + time, date + time + zone, or time + zone. 314c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCall * @stable ICU 4.0 315c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCall */ 3163397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl#define UDAT_ABBR_MONTH_DAY "MMMd" 317c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCall/** 3182cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Constant for date skeleton with numeric month and day. 319c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCall * Used in combinations date + time, date + time + zone, or time + zone. 320446ee4eb4fc4c705a59365252df7a5c253daafa1Steve Naroff * @stable ICU 4.0 321446ee4eb4fc4c705a59365252df7a5c253daafa1Steve Naroff */ 3228538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl#define UDAT_NUM_MONTH_DAY "Md" 3232cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** 3242cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Constant for date skeleton with month, weekday, and day. 325d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff * Used in combinations date + time, date + time + zone, or time + zone. 3263397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * @stable ICU 4.0 3271eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump */ 3288538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl#define UDAT_MONTH_WEEKDAY_DAY "MMMMEEEEd" 3292cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** 3302cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * Constant for date skeleton with abbreviated month, weekday, and day. 331a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * Used in combinations date + time, date + time + zone, or time + zone. 332a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * @stable ICU 4.0 333a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall */ 334a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl#define UDAT_ABBR_MONTH_WEEKDAY_DAY "MMMEd" 335a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl/** 336a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * Constant for date skeleton with numeric month, weekday, and day. 337a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * Used in combinations date + time, date + time + zone, or time + zone. 338a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl * @stable ICU 4.0 339a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall */ 340a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall#define UDAT_NUM_MONTH_WEEKDAY_DAY "MEd" 34151bd803fbdade51d674598ed45da3d54190a656cJohn McCall 342a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall/* Skeletons for times. */ 34351bd803fbdade51d674598ed45da3d54190a656cJohn McCall 344a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall/** 345a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * Constant for date skeleton with hour, with the locale's preferred hour format (12 or 24). 34651bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @stable ICU 4.0 34751bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 348a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall#define UDAT_HOUR "j" 349a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall#ifndef U_HIDE_DRAFT_API 350a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall/** 351a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * Constant for date skeleton with hour in 24-hour presentation. 35251bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @draft ICU 51 35351bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 35451bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_HOUR24 "H" 35551bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 356ddf889a2ad2888f1dea573987bbe952d9912c1a0Douglas Gregor * Constant for date skeleton with minute. 357ddf889a2ad2888f1dea573987bbe952d9912c1a0Douglas Gregor * @draft ICU 51 358ddf889a2ad2888f1dea573987bbe952d9912c1a0Douglas Gregor */ 359ddf889a2ad2888f1dea573987bbe952d9912c1a0Douglas Gregor#define UDAT_MINUTE "m" 360ddf889a2ad2888f1dea573987bbe952d9912c1a0Douglas Gregor#endif /* U_HIDE_DRAFT_API */ 361ddf889a2ad2888f1dea573987bbe952d9912c1a0Douglas Gregor/** 362ddf889a2ad2888f1dea573987bbe952d9912c1a0Douglas Gregor * Constant for date skeleton with hour and minute, with the locale's preferred hour format (12 or 24). 36351bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Used in combinations date + time, date + time + zone, or time + zone. 36451bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @stable ICU 4.0 36551bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 36651bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_HOUR_MINUTE "jm" 36751bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 36851bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for date skeleton with hour and minute in 24-hour presentation. 36951bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Used in combinations date + time, date + time + zone, or time + zone. 37051bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @stable ICU 4.0 37151bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 37251bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_HOUR24_MINUTE "Hm" 37351bd803fbdade51d674598ed45da3d54190a656cJohn McCall#ifndef U_HIDE_DRAFT_API 37451bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 37551bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for date skeleton with second. 37651bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @draft ICU 51 37751bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 37851bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_SECOND "s" 37951bd803fbdade51d674598ed45da3d54190a656cJohn McCall#endif /* U_HIDE_DRAFT_API */ 38051bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 38151bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for date skeleton with hour, minute, and second, 38251bd803fbdade51d674598ed45da3d54190a656cJohn McCall * with the locale's preferred hour format (12 or 24). 38351bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Used in combinations date + time, date + time + zone, or time + zone. 38451bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @stable ICU 4.0 38551bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 38651bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_HOUR_MINUTE_SECOND "jms" 38751bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 38851bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for date skeleton with hour, minute, and second in 38951bd803fbdade51d674598ed45da3d54190a656cJohn McCall * 24-hour presentation. 39051bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Used in combinations date + time, date + time + zone, or time + zone. 39151bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @stable ICU 4.0 39251bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 39351bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_HOUR24_MINUTE_SECOND "Hms" 39451bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 39551bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for date skeleton with minute and second. 39651bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Used in combinations date + time, date + time + zone, or time + zone. 39751bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @stable ICU 4.0 39851bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 39951bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_MINUTE_SECOND "ms" 40051bd803fbdade51d674598ed45da3d54190a656cJohn McCall 40151bd803fbdade51d674598ed45da3d54190a656cJohn McCall/* Skeletons for time zones. */ 40251bd803fbdade51d674598ed45da3d54190a656cJohn McCall 40351bd803fbdade51d674598ed45da3d54190a656cJohn McCall#ifndef U_HIDE_DRAFT_API 40451bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 40551bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for <i>generic location format</i>, such as Los Angeles Time; 40651bd803fbdade51d674598ed45da3d54190a656cJohn McCall * used in combinations date + time + zone, or time + zone. 40751bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 40851bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 40951bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @draft ICU 51 41051bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 41151bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_LOCATION_TZ "VVVV" 41251bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 41351bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for <i>generic non-location format</i>, such as Pacific Time; 41451bd803fbdade51d674598ed45da3d54190a656cJohn McCall * used in combinations date + time + zone, or time + zone. 41551bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 41651bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 41751bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @draft ICU 51 41851bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 41951bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_GENERIC_TZ "vvvv" 42051bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 42151bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for <i>generic non-location format</i>, abbreviated if possible, such as PT; 42251bd803fbdade51d674598ed45da3d54190a656cJohn McCall * used in combinations date + time + zone, or time + zone. 42351bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 424ed97649e9574b9d854fa4d6109c9333ae0993554John McCall * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 425ed97649e9574b9d854fa4d6109c9333ae0993554John McCall * @draft ICU 51 426ed97649e9574b9d854fa4d6109c9333ae0993554John McCall */ 42751bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_ABBR_GENERIC_TZ "v" 42851bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 42951bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for <i>specific non-location format</i>, such as Pacific Daylight Time; 43051bd803fbdade51d674598ed45da3d54190a656cJohn McCall * used in combinations date + time + zone, or time + zone. 431cfb708c354e2f30ccc5cba9d644650f408a1ec3eJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 432cfb708c354e2f30ccc5cba9d644650f408a1ec3eJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 433cfb708c354e2f30ccc5cba9d644650f408a1ec3eJohn McCall * @draft ICU 51 43451bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 43551bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_SPECIFIC_TZ "zzzz" 436cfb708c354e2f30ccc5cba9d644650f408a1ec3eJohn McCall/** 437cfb708c354e2f30ccc5cba9d644650f408a1ec3eJohn McCall * Constant for <i>specific non-location format</i>, abbreviated if possible, such as PDT; 438cfb708c354e2f30ccc5cba9d644650f408a1ec3eJohn McCall * used in combinations date + time + zone, or time + zone. 439cfb708c354e2f30ccc5cba9d644650f408a1ec3eJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 44051bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 44151bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @draft ICU 51 44251bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 443a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall#define UDAT_ABBR_SPECIFIC_TZ "z" 44451bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 44551bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for <i>localized GMT/UTC format</i>, such as GMT+8:00 or HPG-8:00; 446a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * used in combinations date + time + zone, or time + zone. 44751bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Date_Format_Patterns">LDML Date Format Patterns</a> 44851bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @see <a href="http://unicode.org/reports/tr35/#Time_Zone_Fallback">LDML Time Zone Fallback</a> 449a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * @draft ICU 51 45051bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 45151bd803fbdade51d674598ed45da3d54190a656cJohn McCall#define UDAT_ABBR_UTC_TZ "ZZZZ" 452a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall#endif /* U_HIDE_DRAFT_API */ 45349a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall 45449a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall/* deprecated skeleton constants */ 45549a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall 45649a832bd499d6f61c23655f1fac99f0dd229756eJohn McCall#ifndef U_HIDE_DEPRECATED_API 45751bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 45851bd803fbdade51d674598ed45da3d54190a656cJohn McCall * Constant for date skeleton with standalone month. 459833ca991c1bfc967f0995974ca86f66ba1f666b5John McCall * @deprecated ICU 50 Use UDAT_MONTH instead. 460833ca991c1bfc967f0995974ca86f66ba1f666b5John McCall */ 461833ca991c1bfc967f0995974ca86f66ba1f666b5John McCall#define UDAT_STANDALONE_MONTH "LLLL" 462833ca991c1bfc967f0995974ca86f66ba1f666b5John McCall/** 46344f8c37e378f716e8cbb600e3800f437cf58f9e5Argyrios Kyrtzidis * Constant for date skeleton with standalone abbreviated month. 46444f8c37e378f716e8cbb600e3800f437cf58f9e5Argyrios Kyrtzidis * @deprecated ICU 50 Use UDAT_ABBR_MONTH instead. 465a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall */ 466465d41b92b2c862f3062c412a0538db65c6a2661Abramo Bagnara#define UDAT_ABBR_STANDALONE_MONTH "LLL" 467e4da7a034a2fcf4b14d0bcc28d05de0878159061Abramo Bagnara 468e4da7a034a2fcf4b14d0bcc28d05de0878159061Abramo Bagnara/** 469a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * Constant for date skeleton with hour, minute, and generic timezone. 4703cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4John McCall * @deprecated ICU 50 Use instead UDAT_HOUR_MINUTE UDAT_ABBR_GENERIC_TZ or some other timezone presentation. 4713cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4John McCall */ 4723cb0ebd5f76abcb776f7cb4062bd79e3268c0dc4John McCall#define UDAT_HOUR_MINUTE_GENERIC_TZ "jmv" 4734714c12a1ab759156b78be8f109ea4c12213af57Douglas Gregor/** 474e4da7a034a2fcf4b14d0bcc28d05de0878159061Abramo Bagnara * Constant for date skeleton with hour, minute, and timezone. 475e4da7a034a2fcf4b14d0bcc28d05de0878159061Abramo Bagnara * @deprecated ICU 50 Use instead UDAT_HOUR_MINUTE UDAT_ABBR_SPECIFIC_TZ or some other timezone presentation. 47651bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 477a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall#define UDAT_HOUR_MINUTE_TZ "jmz" 47833500955d731c73717af52088b7fc0e7a85681e7John McCall/** 47933500955d731c73717af52088b7fc0e7a85681e7John McCall * Constant for date skeleton with hour and generic timezone. 48033500955d731c73717af52088b7fc0e7a85681e7John McCall * @deprecated ICU 50 Use instead UDAT_HOUR UDAT_ABBR_GENERIC_TZ or some other timezone presentation. 48133500955d731c73717af52088b7fc0e7a85681e7John McCall */ 48233500955d731c73717af52088b7fc0e7a85681e7John McCall#define UDAT_HOUR_GENERIC_TZ "jv" 48333500955d731c73717af52088b7fc0e7a85681e7John McCall/** 48433500955d731c73717af52088b7fc0e7a85681e7John McCall * Constant for date skeleton with hour and timezone. 48533500955d731c73717af52088b7fc0e7a85681e7John McCall * @deprecated ICU 50 Use instead UDAT_HOUR UDAT_ABBR_SPECIFIC_TZ or some other timezone presentation. 48644f8c37e378f716e8cbb600e3800f437cf58f9e5Argyrios Kyrtzidis */ 48744f8c37e378f716e8cbb600e3800f437cf58f9e5Argyrios Kyrtzidis#define UDAT_HOUR_TZ "jz" 48833500955d731c73717af52088b7fc0e7a85681e7John McCall#endif /* U_HIDE_DEPRECATED_API */ 48951bd803fbdade51d674598ed45da3d54190a656cJohn McCall 49051bd803fbdade51d674598ed45da3d54190a656cJohn McCall/** 491c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCall * FieldPosition and UFieldPosition selectors for format fields 492c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCall * defined by DateFormat and UDateFormat. 493c12c5bba6ceb6acd4e51e7a0fc03257da9cfd44eJohn McCall * @stable ICU 3.0 49454e14c4db764c0636160d26c5bbf491637c83a76John McCall */ 49554e14c4db764c0636160d26c5bbf491637c83a76John McCalltypedef enum UDateFormatField { 49654e14c4db764c0636160d26c5bbf491637c83a76John McCall /** 49754e14c4db764c0636160d26c5bbf491637c83a76John McCall * FieldPosition and UFieldPosition selector for 'G' field alignment, 498a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall * corresponding to the UCAL_ERA field. 49951bd803fbdade51d674598ed45da3d54190a656cJohn McCall * @stable ICU 3.0 50051bd803fbdade51d674598ed45da3d54190a656cJohn McCall */ 501a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall UDAT_ERA_FIELD = 0, 502a1ee0c548b8aa4aaf93d1917e304e3da13171a08John McCall 5034dcf151a555ff51e4d643e8e6eeb80f121d11d1bChris Lattner /** 504a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl * FieldPosition and UFieldPosition selector for 'y' field alignment, 5052cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * corresponding to the UCAL_YEAR field. 5062cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * @stable ICU 3.0 507b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 508b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_YEAR_FIELD = 1, 509a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl 510b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner /** 511b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'M' field alignment, 512b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_MONTH field. 513b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 514b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 515b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_MONTH_FIELD = 2, 516b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 517b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner /** 518b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'd' field alignment, 519b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_DATE field. 520b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 521b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 522b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_DATE_FIELD = 3, 523b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 524a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl /** 525b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'k' field alignment, 526b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_HOUR_OF_DAY field. 527b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * UDAT_HOUR_OF_DAY1_FIELD is used for the one-based 24-hour clock. 528b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * For example, 23:59 + 01:00 results in 24:59. 529b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 5300558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5310558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_HOUR_OF_DAY1_FIELD = 4, 5320558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 533a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl /** 5348538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * FieldPosition and UFieldPosition selector for 'H' field alignment, 5350558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_HOUR_OF_DAY field. 5360558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * UDAT_HOUR_OF_DAY0_FIELD is used for the zero-based 24-hour clock. 5370558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * For example, 23:59 + 01:00 results in 00:59. 5380558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5390558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5400558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_HOUR_OF_DAY0_FIELD = 5, 5410558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5420558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 5430558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 'm' field alignment, 5440558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_MINUTE field. 5450558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5460558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5470558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_MINUTE_FIELD = 6, 5480558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5490558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 5500558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 's' field alignment, 5510558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_SECOND field. 5520558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5530558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5540558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_SECOND_FIELD = 7, 5550558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5560558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 5570558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 'S' field alignment, 5580558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_MILLISECOND field. 5590558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * 5600558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * Note: Time formats that use 'S' can display a maximum of three 5610558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * significant digits for fractional seconds, corresponding to millisecond 5620558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * resolution and a fractional seconds sub-pattern of SSS. If the 5630558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * sub-pattern is S or SS, the fractional seconds value will be truncated 5640558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * (not rounded) to the number of display places specified. If the 5650558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * fractional seconds sub-pattern is longer than SSS, the additional 5660558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * display places will be filled with zeros. 5670558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5680558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5690558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_FRACTIONAL_SECOND_FIELD = 8, 5700558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5710558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 5720558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 'E' field alignment, 5730558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_DAY_OF_WEEK field. 5740558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5750558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5760558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_DAY_OF_WEEK_FIELD = 9, 5770558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5780558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 5790558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 'D' field alignment, 5800558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_DAY_OF_YEAR field. 5810558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5820558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5830558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_DAY_OF_YEAR_FIELD = 10, 5840558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5850558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 5860558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 'F' field alignment, 5870558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_DAY_OF_WEEK_IN_MONTH field. 5880558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5890558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5900558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_DAY_OF_WEEK_IN_MONTH_FIELD = 11, 5910558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5920558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 5930558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 'w' field alignment, 5940558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * corresponding to the UCAL_WEEK_OF_YEAR field. 5950558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * @stable ICU 3.0 5960558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 5970558df2da807646e65d4fa290f4e92114af1a746Chris Lattner UDAT_WEEK_OF_YEAR_FIELD = 12, 5980558df2da807646e65d4fa290f4e92114af1a746Chris Lattner 5990558df2da807646e65d4fa290f4e92114af1a746Chris Lattner /** 6000558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * FieldPosition and UFieldPosition selector for 'W' field alignment, 601eb7f96141f754150a92433286fa385910a22f494Sam Weinig * corresponding to the UCAL_WEEK_OF_MONTH field. 602eb7f96141f754150a92433286fa385910a22f494Sam Weinig * @stable ICU 3.0 603eb7f96141f754150a92433286fa385910a22f494Sam Weinig */ 604eb7f96141f754150a92433286fa385910a22f494Sam Weinig UDAT_WEEK_OF_MONTH_FIELD = 13, 605eb7f96141f754150a92433286fa385910a22f494Sam Weinig 606eb7f96141f754150a92433286fa385910a22f494Sam Weinig /** 607eb7f96141f754150a92433286fa385910a22f494Sam Weinig * FieldPosition and UFieldPosition selector for 'a' field alignment, 608eb7f96141f754150a92433286fa385910a22f494Sam Weinig * corresponding to the UCAL_AM_PM field. 609eb7f96141f754150a92433286fa385910a22f494Sam Weinig * @stable ICU 3.0 6100558df2da807646e65d4fa290f4e92114af1a746Chris Lattner */ 611b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_AM_PM_FIELD = 14, 6121eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 613a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl /** 614b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'h' field alignment, 615b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_HOUR field. 6161eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * UDAT_HOUR1_FIELD is used for the one-based 12-hour clock. 6178538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * For example, 11:30 PM + 1 hour results in 12:30 AM. 6188538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @stable ICU 3.0 6191eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump */ 6203397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl UDAT_HOUR1_FIELD = 15, 621f29f0a28c4d9599b389bbb6d186e14af753dc5a3Sebastian Redl 62251e774d42269e3b22d746184c0b9076fc13b32e6Zhongxing Xu /** 623b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'K' field alignment, 624b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_HOUR field. 625b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * UDAT_HOUR0_FIELD is used for the zero-based 12-hour clock. 626ab41e63821dc60ad144d0684df8d79a9eef86b75Douglas Gregor * For example, 11:30 PM + 1 hour results in 00:30 AM. 627b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 628b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 629b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_HOUR0_FIELD = 16, 630b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 631b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner /** 632b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'z' field alignment, 63349b96d1a382ae9f31456166f1a734d3f7f30b992Argyrios Kyrtzidis * corresponding to the UCAL_ZONE_OFFSET and 634b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * UCAL_DST_OFFSET fields. 635b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 636b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 637b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_TIMEZONE_FIELD = 17, 6387f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor 6397f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor /** 6404fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * FieldPosition and UFieldPosition selector for 'Y' field alignment, 641b81c17092039f39be60e9656a37cffbdf2e2c783Douglas Gregor * corresponding to the UCAL_YEAR_WOY field. 6425b4ec636637c9d876102240127cc0dca9280e83aTed Kremenek * @stable ICU 3.0 6436a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor */ 644a93e3b5bde9f0a7b59215f19f176f7d69881b81cSebastian Redl UDAT_YEAR_WOY_FIELD = 18, 645320198303df7c16950d83ae79c3f702b84badcf7Fariborz Jahanian 6466a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor /** 647b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'e' field alignment, 6482f4efd10c805cb779618c1a22a35eb07b5043c4eChris Lattner * corresponding to the UCAL_DOW_LOCAL field. 649b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 650b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 651b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_DOW_LOCAL_FIELD = 19, 652b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 653b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner /** 6541eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * FieldPosition and UFieldPosition selector for 'u' field alignment, 655b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_EXTENDED_YEAR field. 6562f4efd10c805cb779618c1a22a35eb07b5043c4eChris Lattner * @stable ICU 3.0 657b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 658b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_EXTENDED_YEAR_FIELD = 20, 659b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 6606a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor /** 6616a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * FieldPosition and UFieldPosition selector for 'g' field alignment, 6626a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * corresponding to the UCAL_JULIAN_DAY field. 66361d60ee6aa0a5ded0ddcf48679673b37506a1895Douglas Gregor * @stable ICU 3.0 66461d60ee6aa0a5ded0ddcf48679673b37506a1895Douglas Gregor */ 665b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_JULIAN_DAY_FIELD = 21, 666b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 667b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner /** 668b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'A' field alignment, 669b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_MILLISECONDS_IN_DAY field. 670b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 671b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 672b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_MILLISECONDS_IN_DAY_FIELD = 22, 673b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 674b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner /** 675b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'Z' field alignment, 676b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_ZONE_OFFSET and 677b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * UCAL_DST_OFFSET fields. 678b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.0 679b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 680b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_TIMEZONE_RFC_FIELD = 23, 681b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 682b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner /** 683b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * FieldPosition and UFieldPosition selector for 'v' field alignment, 684b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_ZONE_OFFSET field. 685a53d2cbe37e4be0d95b9d3e09f74eafae31fc940John McCall * @stable ICU 3.4 686d1b3c2dd5bc1f3103bee6137957aa7c5f8f2f0bcSteve Naroff */ 6870ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner UDAT_TIMEZONE_GENERIC_FIELD = 24, 6880ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner /** 6890ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * FieldPosition selector for 'c' field alignment, 6900ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * corresponding to the {@link #UCAL_DOW_LOCAL} field. 6910ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * This displays the stand alone day name, if available. 6920ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * @stable ICU 3.4 6930ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner */ 6940ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner UDAT_STANDALONE_DAY_FIELD = 25, 6950ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner 6960ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner /** 6970ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * FieldPosition selector for 'L' field alignment, 6980ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * corresponding to the {@link #UCAL_MONTH} field. 6990ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * This displays the stand alone month name, if available. 7000ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * @stable ICU 3.4 7010ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner */ 7020ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner UDAT_STANDALONE_MONTH_FIELD = 26, 7030ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner 7040ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner /** 7050ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * FieldPosition selector for "Q" field alignment, 7060ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * corresponding to quarters. This is implemented 707b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * using the {@link #UCAL_MONTH} field. This 708b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * displays the quarter. 7090ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * @stable ICU 3.6 710b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 7110ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner UDAT_QUARTER_FIELD = 27, 7120ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner 7130ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner /** 7140ff8cda4442cff571aba1be91dd16f64a0bf16aaChris Lattner * FieldPosition selector for the "q" field alignment, 71561d60ee6aa0a5ded0ddcf48679673b37506a1895Douglas Gregor * corresponding to stand-alone quarters. This is 7160558df2da807646e65d4fa290f4e92114af1a746Chris Lattner * implemented using the {@link #UCAL_MONTH} field. 717b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * This displays the stand-alone quarter. 718b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * @stable ICU 3.6 719b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner */ 720b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner UDAT_STANDALONE_QUARTER_FIELD = 28, 721b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner 722e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor /** 723e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * FieldPosition and UFieldPosition selector for 'V' field alignment, 7241eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * corresponding to the UCAL_ZONE_OFFSET field. 725e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * @stable ICU 3.8 726e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor */ 727e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor UDAT_TIMEZONE_SPECIAL_FIELD = 29, 728e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor 729e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor /** 730e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * FieldPosition selector for "U" field alignment, 731e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * corresponding to cyclic year names. This is implemented 7321eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * using the {@link #UCAL_YEAR} field. This displays 733e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * the cyclic year name, if available. 734e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * @stable ICU 49 7351eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump */ 736e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor UDAT_YEAR_NAME_FIELD = 30, 737e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor 7381eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump#ifndef U_HIDE_DRAFT_API 739e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor /** 740e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * FieldPosition selector for 'O' field alignment, 741e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. 742e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * This displays the localized GMT format. 743e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * @draft ICU 51 7441eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump */ 745e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor UDAT_TIMEZONE_LOCALIZED_GMT_OFFSET_FIELD = 31, 746e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor 747e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor /** 7481eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * FieldPosition selector for 'X' field alignment, 749e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. 750e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * This displays the ISO 8601 local time offset format or UTC indicator ("Z"). 751e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * @draft ICU 51 752e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor */ 753e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor UDAT_TIMEZONE_ISO_FIELD = 32, 7541eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 755e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor /** 756e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * FieldPosition selector for 'x' field alignment, 757b145b1e9de866e79fb386e4a074dc0b41853acf3Chris Lattner * corresponding to the UCAL_ZONE_OFFSET and UCAL_DST_OFFSETfields. 7583397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * This displays the ISO 8601 local time offset format. 759a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl * @draft ICU 51 7602bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor */ 761b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor UDAT_TIMEZONE_ISO_LOCAL_FIELD = 33, 762e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor#endif /* U_HIDE_DRAFT_API */ 763e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor 764e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor /** 76577f4603c8b142e642300959a601ecec2b7c8e288Sebastian Redl * Number of FieldPosition and UFieldPosition selectors for 7668538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * DateFormat and UDateFormat. 7673397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * Valid selectors range from 0 to UDAT_FIELD_COUNT-1. 7683397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * This value is subject to change if new fields are defined 769e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * in the future. 770e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * @stable ICU 3.0 771e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor */ 77277f4603c8b142e642300959a601ecec2b7c8e288Sebastian Redl UDAT_FIELD_COUNT = 34 77377f4603c8b142e642300959a601ecec2b7c8e288Sebastian Redl 774e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor} UDateFormatField; 7751eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 776e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor 7778538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl/** 7788538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Maps from a UDateFormatField to the corresponding UCalendarDateFields. 7798538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * Note: since the mapping is many-to-one, there is no inverse mapping. 780e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * @param field the UDateFormatField. 781e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * @return the UCalendarDateField. This will be UCAL_FIELD_COUNT in case 782e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * of error (e.g., the input field is UDAT_FIELD_COUNT). 78377f4603c8b142e642300959a601ecec2b7c8e288Sebastian Redl * @stable ICU 4.4 78477f4603c8b142e642300959a601ecec2b7c8e288Sebastian Redl */ 78577f4603c8b142e642300959a601ecec2b7c8e288Sebastian RedlU_STABLE UCalendarDateFields U_EXPORT2 7861eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumpudat_toCalendarDateField(UDateFormatField field); 787b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor 788b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor 789b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor/** 790b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * Open a new UDateFormat for formatting and parsing dates and times. 7918538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * A UDateFormat may be used to format dates in calls to {@link #udat_format }, 792b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * and to parse dates in calls to {@link #udat_parse }. 793b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * @param timeStyle The style used to format times; one of UDAT_FULL, UDAT_LONG, 794b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * UDAT_MEDIUM, UDAT_SHORT, UDAT_DEFAULT, or UDAT_NONE (relative time styles 795b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * are not currently supported). 7961eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * When the pattern parameter is used, pass in UDAT_PATTERN for both timeStyle and dateStyle. 79711a18f115e8974ef24e8d5bb549ed3289871efa4Kovarththanan Rajaratnam * @param dateStyle The style used to format dates; one of UDAT_FULL, UDAT_LONG, 798b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * UDAT_MEDIUM, UDAT_SHORT, UDAT_DEFAULT, UDAT_FULL_RELATIVE, UDAT_LONG_RELATIVE, 799aba54a95e9d5e4dc9056abec6bb70ea777c4a7bcKovarththanan Rajaratnam * UDAT_MEDIUM_RELATIVE, UDAT_SHORT_RELATIVE, or UDAT_NONE. 8001eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * When the pattern parameter is used, pass in UDAT_PATTERN for both timeStyle and dateStyle. 801e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor * As currently implemented, 802b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * relative date formatting only affects a limited range of calendar days before or 8038538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * after the current date, based on the CLDR <field type="day">/<relative> data: For 804ec312a1f0557b1d27f3eb6cf49acbf7e72696422Daniel Dunbar * example, in English, "Yesterday", "Today", and "Tomorrow". Outside of this range, 805b64c19365deab788753d29c9bc881253c3f16f37Douglas Gregor * dates are formatted using the corresponding non-relative style. 80611a18f115e8974ef24e8d5bb549ed3289871efa4Kovarththanan Rajaratnam * @param locale The locale specifying the formatting conventions 807f7a96a39958b3f919f26764777eec948b43d74bcTed Kremenek * @param tzID A timezone ID specifying the timezone to use. If 0, use 808f7a96a39958b3f919f26764777eec948b43d74bcTed Kremenek * the default timezone. 8098538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @param tzIDLength The length of tzID, or -1 if null-terminated. 810f7a96a39958b3f919f26764777eec948b43d74bcTed Kremenek * @param pattern A pattern specifying the format to use. 811f7a96a39958b3f919f26764777eec948b43d74bcTed Kremenek * @param patternLength The number of characters in the pattern, or -1 if null-terminated. 812445e23e9b909ec8e21303c7dd82c90b72fc09ac4Douglas Gregor * @param status A pointer to an UErrorCode to receive any errors 8138538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @return A pointer to a UDateFormat to use for formatting dates and times, or 0 if 814f7a96a39958b3f919f26764777eec948b43d74bcTed Kremenek * an error occurred. 815f7a96a39958b3f919f26764777eec948b43d74bcTed Kremenek * @stable ICU 2.0 8162bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregor */ 8172bec0410d268779f601bd509e0302a500af7ac6aDouglas GregorU_STABLE UDateFormat* U_EXPORT2 8182bec0410d268779f601bd509e0302a500af7ac6aDouglas Gregorudat_open(UDateFormatStyle timeStyle, 819a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl UDateFormatStyle dateStyle, 8200a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor const char *locale, 8210a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor const UChar *tzID, 8220a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor int32_t tzIDLength, 8230a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor const UChar *pattern, 8240a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor int32_t patternLength, 8250a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor UErrorCode *status); 826eb5d7b752651283de5abfcc2f91df7227582a08dChandler Carruth 8270a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor 8280a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor/** 8290a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor* Close a UDateFormat. 8300a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor* Once closed, a UDateFormat may no longer be used. 8310a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor* @param format The formatter to close. 8320a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor* @stable ICU 2.0 8330a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor*/ 8340a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas GregorU_STABLE void U_EXPORT2 8351eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumpudat_close(UDateFormat* format); 8360a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor 8370a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor 83811a18f115e8974ef24e8d5bb549ed3289871efa4Kovarththanan Rajaratnam/** 839412e798941ca64e2e6b084323915fa9aa5f6bdf3Fariborz Jahanian * DateFormat boolean attributes 84011a18f115e8974ef24e8d5bb549ed3289871efa4Kovarththanan Rajaratnam * @internal ICU technology preview 841412e798941ca64e2e6b084323915fa9aa5f6bdf3Fariborz Jahanian */ 8424c9d8d0eca5ca635d9a30222f690db9140e98325Fariborz Jahaniantypedef enum UDateFormatBooleanAttribute { 8431eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump /** 8440a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * indicates whether whitespace is allowed. Includes trailing dot tolerance. 8450a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @internal ICU technology preview 8460a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor */ 847b9e7e63ae2098bc02e79c032df0a3124d09a4b4eNate Begeman UDAT_PARSE_ALLOW_WHITESPACE, 8480a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /** 84973482884560be041d86eccbd7dd5a6918677393bDaniel Dunbar * indicates tolerance of numeric data when String data may be assumed. eg: UDAT_YEAR_NAME_FIELD, 8500a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * UDAT_STANDALONE_MONTH_FIELD, UDAT_DAY_OF_WEEK_FIELD 8510a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @internal ICU technology preview 8520a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor */ 8530a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor UDAT_PARSE_ALLOW_NUMERIC, 8540a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor /** 855ea5ce4705df0743093925585d8edc80e0d8fe3ffChris Lattner * count boolean date format constants 856ea5ce4705df0743093925585d8edc80e0d8fe3ffChris Lattner * @internal ICU technology preview 857972d954bd216c86a961bb7f81c53af85de17c2f0Douglas Gregor */ 8580a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor UDAT_BOOLEAN_ATTRIBUTE_COUNT 8590a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor} UDateFormatBooleanAttribute; 8600a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor 8610a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor#ifndef U_HIDE_INTERNAL_API 8620a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor/** 8630a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * Get a boolean attribute associated with a UDateFormat. 864a4d71455f0d418e16cc0c5c5aa55a3bad3494aeeChris Lattner * An example would be a true value for a key of UDAT_PARSE_ALLOW_WHITESPACE indicating allowing whitespace leniency. 865a4d71455f0d418e16cc0c5c5aa55a3bad3494aeeChris Lattner * If the formatter does not understand the attribute, -1 is returned. 8660a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @param fmt The formatter to query. 8670a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @param attr The attribute to query; e.g. UDAT_PARSE_ALLOW_WHITESPACE. 8681eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * @param status A pointer to an UErrorCode to receive any errors 8690a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @return The value of attr. 8700a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @internal technology preview 8710a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor */ 8720a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas GregorU_INTERNAL UBool U_EXPORT2 8730a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregorudat_getBooleanAttribute(const UDateFormat* fmt, UDateFormatBooleanAttribute attr, UErrorCode* status); 8740a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor 8750a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor/** 8760a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * Set a boolean attribute associated with a UDateFormat. 877a33d9b4ebf732a5da6d56fd7319ff6c020789b1cAnders Carlsson * An example of a boolean attribute is parse leniency control. If the formatter does not understand 878a33d9b4ebf732a5da6d56fd7319ff6c020789b1cAnders Carlsson * the attribute, the call is ignored. 87915b91764d08e886391c865c4a444d7b51141c284Eli Friedman * @param fmt The formatter to set. 88015b91764d08e886391c865c4a444d7b51141c284Eli Friedman * @param attr The attribute to set; one of UDAT_PARSE_ALLOW_WHITESPACE or UDAT_PARSE_ALLOW_NUMERIC 881a6fda124bf380479529d6a80b84b62cacd3cb707John Thompson * @param newValue The new value of attr. 8820a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @param status A pointer to an UErrorCode to receive any errors 8830a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor * @internal ICU technology preview 884ab8e281b32a3d3b9b18257d26844362bf806ecdcDaniel Dunbar */ 8850a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas GregorU_INTERNAL void U_EXPORT2 886b9e7e63ae2098bc02e79c032df0a3124d09a4b4eNate Begemanudat_setBooleanAttribute(UDateFormat *fmt, UDateFormatBooleanAttribute attr, UBool, UErrorCode* status); 8879c276ae0f24d4cee8f7954069d4b8eae45d0447dMike Stump 88892f5822df6a0d7571df44b5d279ed4f017fbb0e6Anders Carlsson#endif /* U_HIDE_INTERNAL_API */ 889a0068fc64351db9c47916566e3b85ab733cd8d6dDouglas Gregor 8908538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl 8910a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor 8920a0428e96c6f1e8bef7a481a9eb69a6f6df38951Douglas Gregor#if U_SHOW_CPLUSPLUS_API 89314f79002e58556798e86168c63e48d533287eda5Douglas Gregor 8944fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas GregorU_NAMESPACE_BEGIN 8954fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor 8964fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor/** 8974fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * \class LocalUDateFormatPointer 8984fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * "Smart pointer" class, closes a UDateFormat via udat_close(). 8993397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl * For most methods see the LocalPointerBase base class. 9004fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * 9014fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * @see LocalPointerBase 9024fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * @see LocalPointer 9031eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * @stable ICU 4.4 9044fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor */ 9054fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas GregorU_DEFINE_LOCAL_OPEN_POINTER(LocalUDateFormatPointer, UDateFormat, udat_close); 9064fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor 9074fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas GregorU_NAMESPACE_END 9082596e429a61602312bdd149786045b8a90cd2d10Daniel Dunbar 9094fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor#endif 9101eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 9111eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump/** 9124fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * Open a copy of a UDateFormat. 9134fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * This function performs a deep copy. 9144fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * @param fmt The format to copy 9154fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * @param status A pointer to an UErrorCode to receive any errors. 9164fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * @return A pointer to a UDateFormat identical to fmt. 9174fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor * @stable ICU 2.0 9184fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor */ 9194fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas GregorU_STABLE UDateFormat* U_EXPORT2 9204fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregorudat_clone(const UDateFormat *fmt, 9214fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor UErrorCode *status); 9221eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump 9234fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor/** 9244fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* Format a date using an UDateFormat. 9254fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* The date will be formatted using the conventions specified in {@link #udat_open } 9261eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* @param format The formatter to use 9274fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param dateToFormat The date to format 9284fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param result A pointer to a buffer to receive the formatted number. 9294fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param resultLength The maximum size of result. 9304fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param position A pointer to a UFieldPosition. On input, position->field 9311eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* is read. On output, position->beginIndex and position->endIndex indicate 9324fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* the beginning and ending indices of field number position->field, if such 9334fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* a field exists. This parameter may be NULL, in which case no field 9341eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* position data is returned. 9354fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param status A pointer to an UErrorCode to receive any errors 9364fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @return The total buffer size needed; if greater than resultLength, the output was truncated. 9374fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @see udat_parse 9384fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @see UFieldPosition 9394fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @stable ICU 2.0 9404fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor*/ 9414fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas GregorU_STABLE int32_t U_EXPORT2 9424fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregorudat_format( const UDateFormat* format, 9434fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor UDate dateToFormat, 9444fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor UChar* result, 9454fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor int32_t resultLength, 9464fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor UFieldPosition* position, 9474fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor UErrorCode* status); 9483397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl 949a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl/** 9504fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* Parse a string into an date/time using a UDateFormat. 9514fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* The date will be parsed using the conventions specified in {@link #udat_open }. 9523397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl* <P> 9534fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* Note that the normal date formats associated with some calendars - such 9541eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* as the Chinese lunar calendar - do not specify enough fields to enable 9554fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* dates to be parsed unambiguously. In the case of the Chinese lunar 956e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* calendar, while the year within the current 60-year cycle is specified, 957e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* the number of such cycles since the start date of the calendar (in the 958e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* UCAL_ERA field of the UCalendar object) is not normally part of the format, 959e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* and parsing may assume the wrong era. For cases such as this it is 9601eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* recommended that clients parse using udat_parseCalendar with the UCalendar 9614fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* passed in set to the current date, or to a date within the era/cycle that 9621eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* should be assumed if absent in the format. 9634fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* 9644fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param format The formatter to use. 9654fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param text The text to parse. 9664fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param textLength The length of text, or -1 if null-terminated. 9674fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param parsePos If not 0, on input a pointer to an integer specifying the offset at which 9684fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* to begin parsing. If not 0, on output the offset at which parsing ended. 9694fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param status A pointer to an UErrorCode to receive any errors 9704fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @return The value of the parsed date/time 9714fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @see udat_format 9724fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @stable ICU 2.0 9734fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor*/ 9748538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian RedlU_STABLE UDate U_EXPORT2 9754fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregorudat_parse(const UDateFormat* format, 9764fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor const UChar* text, 9774fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor int32_t textLength, 9784fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor int32_t *parsePos, 9794fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor UErrorCode *status); 9804fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor 9814fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor/** 9828538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* Parse a string into an date/time using a UDateFormat. 9834fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* The date will be parsed using the conventions specified in {@link #udat_open }. 9844fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* @param format The formatter to use. 985ec312a1f0557b1d27f3eb6cf49acbf7e72696422Daniel Dunbar* @param calendar A calendar set on input to the date and time to be used for 9864fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* missing values in the date/time string being parsed, and set 9874fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* on output to the parsed date/time. When the calendar type is 9884fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor* different from the internal calendar held by the UDateFormat 98914f79002e58556798e86168c63e48d533287eda5Douglas Gregor* instance, the internal calendar will be cloned to a work 99014f79002e58556798e86168c63e48d533287eda5Douglas Gregor* calendar set to the same milliseconds and time zone as this 99114f79002e58556798e86168c63e48d533287eda5Douglas Gregor* calendar parameter, field values will be parsed based on the 99214f79002e58556798e86168c63e48d533287eda5Douglas Gregor* work calendar, then the result (milliseconds and time zone) 99314f79002e58556798e86168c63e48d533287eda5Douglas Gregor* will be set in this calendar. 994c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor* @param text The text to parse. 99514f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param textLength The length of text, or -1 if null-terminated. 99614f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param parsePos If not 0, on input a pointer to an integer specifying the offset at which 9978538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* to begin parsing. If not 0, on output the offset at which parsing ended. 99814f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param status A pointer to an UErrorCode to receive any errors 99914f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @see udat_format 100014f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 100114f79002e58556798e86168c63e48d533287eda5Douglas Gregor*/ 10022d52be56ff595341be3c6cec337af6763804ce66Douglas GregorU_STABLE void U_EXPORT2 10032d52be56ff595341be3c6cec337af6763804ce66Douglas Gregorudat_parseCalendar(const UDateFormat* format, 10042d52be56ff595341be3c6cec337af6763804ce66Douglas Gregor UCalendar* calendar, 100512fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor const UChar* text, 100612fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor int32_t textLength, 100712fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor int32_t *parsePos, 100812fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor UErrorCode *status); 100912fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor 101014f79002e58556798e86168c63e48d533287eda5Douglas Gregor/** 1011c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor* Determine if an UDateFormat will perform lenient parsing. 101214f79002e58556798e86168c63e48d533287eda5Douglas Gregor* With lenient parsing, the parser may use heuristics to interpret inputs that do not 101314f79002e58556798e86168c63e48d533287eda5Douglas Gregor* precisely match the pattern. With strict parsing, inputs must match the pattern. 101414f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param fmt The formatter to query 101514f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @return TRUE if fmt is set to perform lenient parsing, FALSE otherwise. 1016c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor* @see udat_setLenient 101714f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 101814f79002e58556798e86168c63e48d533287eda5Douglas Gregor*/ 10198538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian RedlU_STABLE UBool U_EXPORT2 102014f79002e58556798e86168c63e48d533287eda5Douglas Gregorudat_isLenient(const UDateFormat* fmt); 102114f79002e58556798e86168c63e48d533287eda5Douglas Gregor 102214f79002e58556798e86168c63e48d533287eda5Douglas Gregor/** 102314f79002e58556798e86168c63e48d533287eda5Douglas Gregor* Specify whether an UDateFormat will perform lenient parsing. 102414f79002e58556798e86168c63e48d533287eda5Douglas Gregor* With lenient parsing, the parser may use heuristics to interpret inputs that do not 1025c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor* precisely match the pattern. With strict parsing, inputs must match the pattern. 102614f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param fmt The formatter to set 102714f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param isLenient TRUE if fmt should perform lenient parsing, FALSE otherwise. 102814f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @see dat_isLenient 102914f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 1030c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor*/ 103114f79002e58556798e86168c63e48d533287eda5Douglas GregorU_STABLE void U_EXPORT2 103214f79002e58556798e86168c63e48d533287eda5Douglas Gregorudat_setLenient( UDateFormat* fmt, 10338538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl UBool isLenient); 103414f79002e58556798e86168c63e48d533287eda5Douglas Gregor 1035c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor/** 103614f79002e58556798e86168c63e48d533287eda5Douglas Gregor* Get the UCalendar associated with an UDateFormat. 103714f79002e58556798e86168c63e48d533287eda5Douglas Gregor* A UDateFormat uses a UCalendar to convert a raw value to, for example, 103814f79002e58556798e86168c63e48d533287eda5Douglas Gregor* the day of the week. 103914f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param fmt The formatter to query. 1040c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor* @return A pointer to the UCalendar used by fmt. 104114f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @see udat_setCalendar 104214f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 10438538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl*/ 104414f79002e58556798e86168c63e48d533287eda5Douglas GregorU_STABLE const UCalendar* U_EXPORT2 104514f79002e58556798e86168c63e48d533287eda5Douglas Gregorudat_getCalendar(const UDateFormat* fmt); 104614f79002e58556798e86168c63e48d533287eda5Douglas Gregor 104714f79002e58556798e86168c63e48d533287eda5Douglas Gregor/** 1048f60e9918690fcf02974bc1ebecd42c99d561855eDouglas Gregor* Set the UCalendar associated with an UDateFormat. 1049c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor* A UDateFormat uses a UCalendar to convert a raw value to, for example, 105014f79002e58556798e86168c63e48d533287eda5Douglas Gregor* the day of the week. 105114f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param fmt The formatter to set. 105214f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param calendarToSet A pointer to an UCalendar to be used by fmt. 105314f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @see udat_setCalendar 105414f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 105514f79002e58556798e86168c63e48d533287eda5Douglas Gregor*/ 105614f79002e58556798e86168c63e48d533287eda5Douglas GregorU_STABLE void U_EXPORT2 105714f79002e58556798e86168c63e48d533287eda5Douglas Gregorudat_setCalendar( UDateFormat* fmt, 105814f79002e58556798e86168c63e48d533287eda5Douglas Gregor const UCalendar* calendarToSet); 105914f79002e58556798e86168c63e48d533287eda5Douglas Gregor 1060a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl/** 1061e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* Get the UNumberFormat associated with an UDateFormat. 1062e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* A UDateFormat uses a UNumberFormat to format numbers within a date, 10637f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* for example the day number. 10647f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @param fmt The formatter to query. 1065f04ad69fed38d26fc0d6f7d6fd0a4631ddfbc7feChris Lattner* @return A pointer to the UNumberFormat used by fmt to format numbers. 10668538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* @see udat_setNumberFormat 106714f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 106814f79002e58556798e86168c63e48d533287eda5Douglas Gregor*/ 1069828e18cd80319c67b9b9776d1ed5411161d9f0bfChris LattnerU_STABLE const UNumberFormat* U_EXPORT2 1070828e18cd80319c67b9b9776d1ed5411161d9f0bfChris Lattnerudat_getNumberFormat(const UDateFormat* fmt); 1071828e18cd80319c67b9b9776d1ed5411161d9f0bfChris Lattner 1072828e18cd80319c67b9b9776d1ed5411161d9f0bfChris Lattner/** 10737f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* Set the UNumberFormat associated with an UDateFormat. 10747f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* A UDateFormat uses a UNumberFormat to format numbers within a date, 10757f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* for example the day number. 10767f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @param fmt The formatter to set. 10777f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @param numberFormatToSet A pointer to the UNumberFormat to be used by fmt to format numbers. 10787f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @see udat_getNumberFormat 10797f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @stable ICU 2.0 10807f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor*/ 10817f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas GregorU_STABLE void U_EXPORT2 10827f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregorudat_setNumberFormat( UDateFormat* fmt, 1083e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor const UNumberFormat* numberFormatToSet); 10847f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor 10857f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor/** 10867f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* Get a locale for which date/time formatting patterns are available. 10877f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* A UDateFormat in a locale returned by this function will perform the correct 10887f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* formatting and parsing for the locale. 10891eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* @param localeIndex The index of the desired locale. 10907f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @return A locale for which date/time formatting patterns are available, or 0 if none. 10917f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @see udat_countAvailable 10927f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @stable ICU 2.0 10937f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor*/ 10947f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas GregorU_STABLE const char* U_EXPORT2 10951eb4433ac451dc16f4133a88af2d002ac26c58efMike Stumpudat_getAvailable(int32_t localeIndex); 10967f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor 10977f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor/** 10981eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* Determine how many locales have date/time formatting patterns available. 10997f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* This function is most useful as determining the loop ending condition for 11007f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* calls to {@link #udat_getAvailable }. 11017f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @return The number of locales for which date/time formatting patterns are available. 11027f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @see udat_getAvailable 11037f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @stable ICU 2.0 11047f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor*/ 11057f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas GregorU_STABLE int32_t U_EXPORT2 11067f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregorudat_countAvailable(void); 11077f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor 11088538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl/** 11097f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* Get the year relative to which all 2-digit years are interpreted. 11107f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* For example, if the 2-digit start year is 2100, the year 99 will be 111114f79002e58556798e86168c63e48d533287eda5Douglas Gregor* interpreted as 2199. 111214f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param fmt The formatter to query. 1113090d9b53e32bb30d9e74de895bb59b409bd49e00Chris Lattner* @param status A pointer to an UErrorCode to receive any errors 11147f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* @return The year relative to which all 2-digit years are interpreted. 11150fa7d0b15ea2a224bfe43ac745d411f915da87ddSebastian Redl* @see udat_Set2DigitYearStart 11160fa7d0b15ea2a224bfe43ac745d411f915da87ddSebastian Redl* @stable ICU 2.0 11170fa7d0b15ea2a224bfe43ac745d411f915da87ddSebastian Redl*/ 11180fa7d0b15ea2a224bfe43ac745d411f915da87ddSebastian RedlU_STABLE UDate U_EXPORT2 1119bdfe48ac80573e026595af91e541474dbf02565fDouglas Gregorudat_get2DigitYearStart( const UDateFormat *fmt, 1120bdfe48ac80573e026595af91e541474dbf02565fDouglas Gregor UErrorCode *status); 112111a18f115e8974ef24e8d5bb549ed3289871efa4Kovarththanan Rajaratnam 11227f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor/** 11237f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* Set the year relative to which all 2-digit years will be interpreted. 11247f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor* For example, if the 2-digit start year is 2100, the year 99 will be 112514f79002e58556798e86168c63e48d533287eda5Douglas Gregor* interpreted as 2199. 112614f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param fmt The formatter to set. 112714f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param d The year relative to which all 2-digit years will be interpreted. 112814f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param status A pointer to an UErrorCode to receive any errors 11298538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* @see udat_Set2DigitYearStart 113014f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 11318538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl*/ 113214f79002e58556798e86168c63e48d533287eda5Douglas GregorU_STABLE void U_EXPORT2 11338538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redludat_set2DigitYearStart( UDateFormat *fmt, 11347f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor UDate d, 113514f79002e58556798e86168c63e48d533287eda5Douglas Gregor UErrorCode *status); 113614f79002e58556798e86168c63e48d533287eda5Douglas Gregor 113714f79002e58556798e86168c63e48d533287eda5Douglas Gregor/** 113814f79002e58556798e86168c63e48d533287eda5Douglas Gregor* Extract the pattern from a UDateFormat. 113914f79002e58556798e86168c63e48d533287eda5Douglas Gregor* The pattern will follow the pattern syntax rules. 114014f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param fmt The formatter to query. 114114f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param localized TRUE if the pattern should be localized, FALSE otherwise. 1142bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregor* @param result A pointer to a buffer to receive the pattern. 114314f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param resultLength The maximum size of result. 114414f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @param status A pointer to an UErrorCode to receive any errors 114514f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @return The total buffer size needed; if greater than resultLength, the output was truncated. 114614f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @see udat_applyPattern 114714f79002e58556798e86168c63e48d533287eda5Douglas Gregor* @stable ICU 2.0 11481eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump*/ 11492d52be56ff595341be3c6cec337af6763804ce66Douglas GregorU_STABLE int32_t U_EXPORT2 11502d52be56ff595341be3c6cec337af6763804ce66Douglas Gregorudat_toPattern( const UDateFormat *fmt, 11512d52be56ff595341be3c6cec337af6763804ce66Douglas Gregor UBool localized, 11522d52be56ff595341be3c6cec337af6763804ce66Douglas Gregor UChar *result, 115312fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor int32_t resultLength, 115412fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor UErrorCode *status); 115512fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor 115612fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor/** 115712fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor* Set the pattern used by an UDateFormat. 115812fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor* The pattern should follow the pattern syntax rules. 115912fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor* @param format The formatter to set. 116012fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor* @param localized TRUE if the pattern is localized, FALSE otherwise. 116112fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor* @param pattern The new pattern 116212fab31aa5868b1a6b52246b5a87daa48a338fe2Douglas Gregor* @param patternLength The length of pattern, or -1 if null-terminated. 1163e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* @see udat_toPattern 1164e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor* @stable ICU 2.0 1165e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor*/ 116611a18f115e8974ef24e8d5bb549ed3289871efa4Kovarththanan RajaratnamU_STABLE void U_EXPORT2 1167aba54a95e9d5e4dc9056abec6bb70ea777c4a7bcKovarththanan Rajaratnamudat_applyPattern( UDateFormat *format, 11681eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump UBool localized, 1169e650c8c3bca2f58cad8ffa8aab63126d26e890cdDouglas Gregor const UChar *pattern, 1170ec312a1f0557b1d27f3eb6cf49acbf7e72696422Daniel Dunbar int32_t patternLength); 11717f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor 11727f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor/** 11737f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * The possible types of date format symbols 11747f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * @stable ICU 2.6 11750fa7d0b15ea2a224bfe43ac745d411f915da87ddSebastian Redl */ 117614f79002e58556798e86168c63e48d533287eda5Douglas Gregortypedef enum UDateFormatSymbolType { 117714f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** The era names, for example AD */ 117814f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_ERAS, 117914f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** The month names, for example February */ 118014f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_MONTHS, 118114f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** The short month names, for example Feb. */ 118214f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_SHORT_MONTHS, 118336c35ba0aca641e60e5dbee8efbc620c08b9bd61Douglas Gregor /** The CLDR-style format "wide" weekday names, for example Monday */ 1184e127a0d80155b45dafe77f2b4380e5fa111a3345Chris Lattner UDAT_WEEKDAYS, 118514f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** 1186ec312a1f0557b1d27f3eb6cf49acbf7e72696422Daniel Dunbar * The CLDR-style format "abbreviated" (not "short") weekday names, for example "Mon." 1187ec312a1f0557b1d27f3eb6cf49acbf7e72696422Daniel Dunbar * For the CLDR-style format "short" weekday names, use UDAT_SHORTER_WEEKDAYS. 118814f79002e58556798e86168c63e48d533287eda5Douglas Gregor */ 11898538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl UDAT_SHORT_WEEKDAYS, 1190c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor /** The AM/PM names, for example AM */ 1191ec312a1f0557b1d27f3eb6cf49acbf7e72696422Daniel Dunbar UDAT_AM_PMS, 1192ec312a1f0557b1d27f3eb6cf49acbf7e72696422Daniel Dunbar /** The localized characters */ 11937f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor UDAT_LOCALIZED_CHARS, 11947f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor /** The long era names, for example Anno Domini */ 11950fa7d0b15ea2a224bfe43ac745d411f915da87ddSebastian Redl UDAT_ERA_NAMES, 119614f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** The narrow month names, for example F */ 119714f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_NARROW_MONTHS, 119814f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** The CLDR-style format "narrow" weekday names, for example "M" */ 119914f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_NARROW_WEEKDAYS, 120014f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** Standalone context versions of months */ 120114f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_STANDALONE_MONTHS, 120214f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_STANDALONE_SHORT_MONTHS, 120314f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_STANDALONE_NARROW_MONTHS, 1204f60e9918690fcf02974bc1ebecd42c99d561855eDouglas Gregor /** The CLDR-style stand-alone "wide" weekday names */ 1205f60e9918690fcf02974bc1ebecd42c99d561855eDouglas Gregor UDAT_STANDALONE_WEEKDAYS, 1206bdfe48ac80573e026595af91e541474dbf02565fDouglas Gregor /** 1207bdfe48ac80573e026595af91e541474dbf02565fDouglas Gregor * The CLDR-style stand-alone "abbreviated" (not "short") weekday names. 1208f60e9918690fcf02974bc1ebecd42c99d561855eDouglas Gregor * For the CLDR-style stand-alone "short" weekday names, use UDAT_STANDALONE_SHORTER_WEEKDAYS. 1209c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor */ 121014f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_STANDALONE_SHORT_WEEKDAYS, 121114f79002e58556798e86168c63e48d533287eda5Douglas Gregor /** The CLDR-style stand-alone "narrow" weekday names */ 121214f79002e58556798e86168c63e48d533287eda5Douglas Gregor UDAT_STANDALONE_NARROW_WEEKDAYS, 12137f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor /** The quarters, for example 1st Quarter */ 1214bd94500d3aa60092fb0f1e90f53fb0d03fa502a8Douglas Gregor UDAT_QUARTERS, 12157f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor /** The short quarter names, for example Q1 */ 12167f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor UDAT_SHORT_QUARTERS, 12172eafc1b56347f772729e082e6bac824b0ef1b585Douglas Gregor /** Standalone context versions of quarters */ 12183397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl UDAT_STANDALONE_QUARTERS, 12197f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor UDAT_STANDALONE_SHORT_QUARTERS, 12207f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor#ifndef U_HIDE_DRAFT_API 12217f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor /** 12228538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * The CLDR-style short weekday names, e.g. "Su", Mo", etc. 12237f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * These are named "SHORTER" to contrast with the constants using _SHORT_ 12247f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * above, which actually get the CLDR-style *abbreviated* versions of the 12257f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * corresponding names. 12267f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * @draft ICU 51 12271eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump */ 12287f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor UDAT_SHORTER_WEEKDAYS, 12298538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl /** 12307f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * Standalone version of UDAT_SHORTER_WEEKDAYS. 12317f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor * @draft ICU 51 12327f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor */ 1233ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl UDAT_STANDALONE_SHORTER_WEEKDAYS 1234090d9b53e32bb30d9e74de895bb59b409bd49e00Chris Lattner#endif /* U_HIDE_DRAFT_API */ 12357f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregor} UDateFormatSymbolType; 12363397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl 12377f94b0b0c6791013d2f72ced9b4bedd3b23673a6Douglas Gregorstruct UDateFormatSymbols; 12388538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl/** Date format symbols. 123914f79002e58556798e86168c63e48d533287eda5Douglas Gregor * For usage in C programs. 124014f79002e58556798e86168c63e48d533287eda5Douglas Gregor * @stable ICU 2.6 12414fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor */ 12424fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregortypedef struct UDateFormatSymbols UDateFormatSymbols; 12434fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor 12444fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor/** 12450b1fb988012da21d996c43e36867787a7a07b889Chris Lattner* Get the symbols associated with an UDateFormat. 12460b1fb988012da21d996c43e36867787a7a07b889Chris Lattner* The symbols are what a UDateFormat uses to represent locale-specific data, 12470b1fb988012da21d996c43e36867787a7a07b889Chris Lattner* for example month or day names. 1248a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl* @param fmt The formatter to query. 12497c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @param type The type of symbols to get. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS, 12507c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS 1251c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner* @param symbolIndex The desired symbol of type type. 1252c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner* @param result A pointer to a buffer to receive the pattern. 1253c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner* @param resultLength The maximum size of result. 12548538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* @param status A pointer to an UErrorCode to receive any errors 1255c1f9d828c733ec1eba06d01070735d1f36fda733Chris Lattner* @return The total buffer size needed; if greater than resultLength, the output was truncated. 12562eafc1b56347f772729e082e6bac824b0ef1b585Douglas Gregor* @see udat_countSymbols 12572eafc1b56347f772729e082e6bac824b0ef1b585Douglas Gregor* @see udat_setSymbols 12582eafc1b56347f772729e082e6bac824b0ef1b585Douglas Gregor* @stable ICU 2.0 12598538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl*/ 12601eb4433ac451dc16f4133a88af2d002ac26c58efMike StumpU_STABLE int32_t U_EXPORT2 12613397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redludat_getSymbols(const UDateFormat *fmt, 12622eafc1b56347f772729e082e6bac824b0ef1b585Douglas Gregor UDateFormatSymbolType type, 12632eafc1b56347f772729e082e6bac824b0ef1b585Douglas Gregor int32_t symbolIndex, 12642eafc1b56347f772729e082e6bac824b0ef1b585Douglas Gregor UChar *result, 12651eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump int32_t resultLength, 12667c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner UErrorCode *status); 12677c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner 12686a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor/** 12697c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* Count the number of particular symbols for an UDateFormat. 12707c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* This function is most useful as for detemining the loop termination condition 127142d42b5b84603032e57add333b5b44e0ef99bd9eChris Lattner* for calls to {@link #udat_getSymbols }. 127242d42b5b84603032e57add333b5b44e0ef99bd9eChris Lattner* @param fmt The formatter to query. 12737c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @param type The type of symbols to count. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS, 12747c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS 12753397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl* @return The number of symbols of type type. 12767c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @see udat_getSymbols 12773397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl* @see udat_setSymbols 12783c7f4134603d04b44f997b43c0a9def270f25386Sebastian Redl* @stable ICU 2.0 12797c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner*/ 12807c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris LattnerU_STABLE int32_t U_EXPORT2 12817356a31327be9b3c3434a0c88746028980da5684Chris Lattnerudat_countSymbols( const UDateFormat *fmt, 128237e2684abfe38207fdb90620da062bb18c23f29aDouglas Gregor UDateFormatSymbolType type); 12837c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner 12847c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner/** 12851eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* Set the symbols associated with an UDateFormat. 12867c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* The symbols are what a UDateFormat uses to represent locale-specific data, 12877c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* for example month or day names. 12888538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* @param format The formatter to set 12897c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @param type The type of symbols to set. One of UDAT_ERAS, UDAT_MONTHS, UDAT_SHORT_MONTHS, 12908538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* UDAT_WEEKDAYS, UDAT_SHORT_WEEKDAYS, UDAT_AM_PMS, or UDAT_LOCALIZED_CHARS 12911eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump* @param symbolIndex The index of the symbol to set of type type. 12927c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @param value The new value 12937c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @param valueLength The length of value, or -1 if null-terminated 12947c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @param status A pointer to an UErrorCode to receive any errors 12957c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @see udat_getSymbols 12967c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner* @see udat_countSymbols 12977356a31327be9b3c3434a0c88746028980da5684Chris Lattner* @stable ICU 2.0 12987c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner*/ 12996a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas GregorU_STABLE void U_EXPORT2 13006a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregorudat_setSymbols( UDateFormat *format, 13016a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor UDateFormatSymbolType type, 13026a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor int32_t symbolIndex, 13036a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor UChar *value, 13046a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor int32_t valueLength, 1305c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor UErrorCode *status); 13067c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattner 1307f04ad69fed38d26fc0d6f7d6fd0a4631ddfbc7feChris Lattner/** 1308df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * Get the locale for this date format object. 1309df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * You can choose between valid and actual locale. 1310df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * @param fmt The formatter to get the locale from 1311df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * @param type type of the locale we're looking for (valid or actual) 1312df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * @param status error code for the operation 1313df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * @return the locale name 13141eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * @stable ICU 2.8 1315df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner */ 1316df961c28f84666051ad59d2da1f44023f6366d02Chris LattnerU_STABLE const char* U_EXPORT2 1317df961c28f84666051ad59d2da1f44023f6366d02Chris Lattnerudat_getLocaleByType(const UDateFormat *fmt, 1318df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner ULocDataLocaleType type, 1319df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner UErrorCode* status); 13207356a31327be9b3c3434a0c88746028980da5684Chris Lattner 13211eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump#ifndef U_HIDE_DRAFT_API 1322df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner/** 1323df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * Set a particular UDisplayContext value in the formatter, such as 1324df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * UDISPCTX_CAPITALIZATION_FOR_STANDALONE. 1325df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * @param fmt The formatter for which to set a UDisplayContext value. 13261eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * @param value The UDisplayContext value to set. 13278538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @param status A pointer to an UErrorCode to receive any errors 1328df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner * @draft ICU 51 1329df961c28f84666051ad59d2da1f44023f6366d02Chris Lattner */ 133037e2684abfe38207fdb90620da062bb18c23f29aDouglas GregorU_DRAFT void U_EXPORT2 13317c5d24efcd2e505b5739f7def08dfe25ce59a1b2Chris Lattnerudat_setContext(UDateFormat* fmt, UDisplayContext value, UErrorCode* status); 13326a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor 13336a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor/** 13346a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * Get the formatter's UDisplayContext value for the specified UDisplayContextType, 13356a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * such as UDISPCTX_TYPE_CAPITALIZATION. 13366a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * @param fmt The formatter to query. 13376a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * @param type The UDisplayContextType whose value to return 13386a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * @param status A pointer to an UErrorCode to receive any errors 13396a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * @return The UDisplayContextValue for the specified type. 13406a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor * @draft ICU 51 13416a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor */ 13426a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas GregorU_DRAFT UDisplayContext U_EXPORT2 13436a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregorudat_getContext(UDateFormat* fmt, UDisplayContextType type, UErrorCode* status); 13446a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor 13456a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor#endif /* U_HIDE_DRAFT_API */ 13468538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl 13476a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor#ifndef U_HIDE_INTERNAL_API 13486a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor/** 13496a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* Extract the date pattern from a UDateFormat set for relative date formatting. 13506a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* The pattern will follow the pattern syntax rules. 13516a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param fmt The formatter to query. 13528538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* @param result A pointer to a buffer to receive the pattern. 13536a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param resultLength The maximum size of result. 13546a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param status A pointer to a UErrorCode to receive any errors 13556a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @return The total buffer size needed; if greater than resultLength, the output was truncated. 13566a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @see udat_applyPatternRelative 13576a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @internal ICU 4.2 technology preview 13586a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor*/ 13596a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas GregorU_INTERNAL int32_t U_EXPORT2 13606a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregorudat_toPatternRelativeDate(const UDateFormat *fmt, 13616a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor UChar *result, 13626a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor int32_t resultLength, 13636a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor UErrorCode *status); 13646a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor 13656a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor/** 13666a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* Extract the time pattern from a UDateFormat set for relative date formatting. 13678538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* The pattern will follow the pattern syntax rules. 13686a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param fmt The formatter to query. 13696a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param result A pointer to a buffer to receive the pattern. 13706a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param resultLength The maximum size of result. 13716a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param status A pointer to a UErrorCode to receive any errors 13726a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @return The total buffer size needed; if greater than resultLength, the output was truncated. 1373c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor* @see udat_applyPatternRelative 13746a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @internal ICU 4.2 technology preview 13756a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor*/ 13766a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas GregorU_INTERNAL int32_t U_EXPORT2 13776a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregorudat_toPatternRelativeTime(const UDateFormat *fmt, 13786a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor UChar *result, 13796a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor int32_t resultLength, 13808538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl UErrorCode *status); 13816a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor 13826a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor/** 13836a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* Set the date & time patterns used by a UDateFormat set for relative date formatting. 13846a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* The patterns should follow the pattern syntax rules. 13856a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param format The formatter to set. 13866a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param datePattern The new date pattern 13878538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl* @param datePatternLength The length of datePattern, or -1 if null-terminated. 13886a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param timePattern The new time pattern 13896a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param timePatternLength The length of timePattern, or -1 if null-terminated. 13906a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @param status A pointer to a UErrorCode to receive any errors 1391ade5000c8763f4bec41f452d7efa3a9b2a6d4712Sebastian Redl* @see udat_toPatternRelativeDate, udat_toPatternRelativeTime 13926a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor* @internal ICU 4.2 technology preview 13936a5a23f8e7fb65e028c8092bc1d1a1d9dfe2e9bcDouglas Gregor*/ 13940b1fb988012da21d996c43e36867787a7a07b889Chris LattnerU_INTERNAL void U_EXPORT2 13950b1fb988012da21d996c43e36867787a7a07b889Chris Lattnerudat_applyPatternRelative(UDateFormat *format, 13964fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor const UChar *datePattern, 13974fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor int32_t datePatternLength, 13984fed3f47f6b9e31d603c5c2d1f6d8ec2e1241e57Douglas Gregor const UChar *timePattern, 13990b1fb988012da21d996c43e36867787a7a07b889Chris Lattner int32_t timePatternLength, 14003397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl UErrorCode *status); 1401a4232eb646d89e7d52424bb42eb87d9061f39e63Sebastian Redl 140201b81c4d074bba9c18372d521405dfe32fc4f552Argyrios Kyrtzidis/** 1403c8e5d51f51e46c6f7717761537c6609ef9daf57cArgyrios Kyrtzidis * @internal 1404c8e5d51f51e46c6f7717761537c6609ef9daf57cArgyrios Kyrtzidis * @see udat_open 14051eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump */ 14062cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregortypedef UDateFormat* (U_EXPORT2 *UDateFormatOpener) (UDateFormatStyle timeStyle, 1407c8e5d51f51e46c6f7717761537c6609ef9daf57cArgyrios Kyrtzidis UDateFormatStyle dateStyle, 1408681d7237e1014bf64dd5ead6bf74ae55cdd19e61Sebastian Redl const char *locale, 1409c9490c000f515c29f200a1215328d8ab9a0f3818Douglas Gregor const UChar *tzID, 1410681d7237e1014bf64dd5ead6bf74ae55cdd19e61Sebastian Redl int32_t tzIDLength, 1411681d7237e1014bf64dd5ead6bf74ae55cdd19e61Sebastian Redl const UChar *pattern, 1412681d7237e1014bf64dd5ead6bf74ae55cdd19e61Sebastian Redl int32_t patternLength, 14132cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor UErrorCode *status); 14142cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 14152cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor/** 14161eb4433ac451dc16f4133a88af2d002ac26c58efMike Stump * Register a provider factory 14172cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor * @internal ICU 49 14183397c5570369f19b2d6c52e898f708d75ceede1fSebastian Redl */ 14190953e767ff7817f97b3ab20896b229891eeff45bJohn McCallU_INTERNAL void U_EXPORT2 1420a4923eb7c4b04d360cb2747641a5e92818edf804Douglas Gregorudat_registerOpener(UDateFormatOpener opener, UErrorCode *status); 1421a4923eb7c4b04d360cb2747641a5e92818edf804Douglas Gregor 1422a4923eb7c4b04d360cb2747641a5e92818edf804Douglas Gregor/** 14230953e767ff7817f97b3ab20896b229891eeff45bJohn McCall * Un-Register a provider factory 14248538e8d43a3a9bd439c987c0de37bcbf035dd391Sebastian Redl * @internal ICU 49 14250953e767ff7817f97b3ab20896b229891eeff45bJohn McCall */ 14260953e767ff7817f97b3ab20896b229891eeff45bJohn McCallU_INTERNAL UDateFormatOpener U_EXPORT2 14270953e767ff7817f97b3ab20896b229891eeff45bJohn McCalludat_unregisterOpener(UDateFormatOpener opener, UErrorCode *status); 14280953e767ff7817f97b3ab20896b229891eeff45bJohn McCall#endif /* U_HIDE_INTERNAL_API */ 14292cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 1430b7166334d897e1e4e6a5b428fe2d0ec752ef187fMike Stump 14312cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor#endif /* #if !UCONFIG_NO_FORMATTING */ 14322cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor 14330953e767ff7817f97b3ab20896b229891eeff45bJohn McCall#endif 14342cf2634ffdb4f7c8d46cef3f8e60a55993f1c57aDouglas Gregor