]> git.saurik.com Git - apple/icu.git/blame - icuSources/test/intltest/dtfmttst.cpp
ICU-400.38.tar.gz
[apple/icu.git] / icuSources / test / intltest / dtfmttst.cpp
CommitLineData
b75a7d8f
A
1/********************************************************************
2 * COPYRIGHT:
46f4442e 3 * Copyright (c) 1997-2009, International Business Machines Corporation and
b75a7d8f
A
4 * others. All Rights Reserved.
5 ********************************************************************/
6
7#include "unicode/utypes.h"
8
9#if !UCONFIG_NO_FORMATTING
10
11#include "dtfmttst.h"
12#include "unicode/timezone.h"
13#include "unicode/gregocal.h"
14#include "unicode/smpdtfmt.h"
15#include "unicode/datefmt.h"
16#include "unicode/simpletz.h"
17#include "unicode/strenum.h"
374ca955 18#include "unicode/dtfmtsym.h"
b75a7d8f 19#include "cmemory.h"
374ca955
A
20#include "cstring.h"
21#include "caltest.h" // for fieldName
46f4442e 22#include <stdio.h> // for sprintf
73c04bcf
A
23
24#ifdef U_WINDOWS
25#include "windttst.h"
26#endif
27
28#define ARRAY_SIZE(array) (sizeof array / sizeof array[0])
29
46f4442e 30#define ASSERT_OK(status) if(U_FAILURE(status)) {errln(#status " = %s @ %s:%d", u_errorName(status), __FILE__, __LINE__); return; }
73c04bcf 31
b75a7d8f
A
32// *****************************************************************************
33// class DateFormatTest
34// *****************************************************************************
35
36void DateFormatTest::runIndexedTest( int32_t index, UBool exec, const char* &name, char* /*par*/ )
37{
38 // if (exec) logln((UnicodeString)"TestSuite DateFormatTest");
39 switch (index) {
40 TESTCASE(0,TestEquals);
41 TESTCASE(1,TestTwoDigitYearDSTParse);
42 TESTCASE(2,TestFieldPosition);
43 TESTCASE(3,TestPartialParse994);
44 TESTCASE(4,TestRunTogetherPattern985);
45 TESTCASE(5,TestRunTogetherPattern917);
46 TESTCASE(6,TestCzechMonths459);
47 TESTCASE(7,TestLetterDPattern212);
48 TESTCASE(8,TestDayOfYearPattern195);
49 TESTCASE(9,TestQuotePattern161);
50 TESTCASE(10,TestBadInput135);
51 TESTCASE(11,TestBadInput135a);
52 TESTCASE(12,TestTwoDigitYear);
53 TESTCASE(13,TestDateFormatZone061);
54 TESTCASE(14,TestDateFormatZone146);
55 TESTCASE(15,TestLocaleDateFormat);
56 TESTCASE(16,TestWallyWedel);
57 TESTCASE(17,TestDateFormatCalendar);
58 TESTCASE(18,TestSpaceParsing);
59 TESTCASE(19,TestExactCountFormat);
60 TESTCASE(20,TestWhiteSpaceParsing);
374ca955
A
61 TESTCASE(21,TestInvalidPattern);
62 TESTCASE(22,TestGeneral);
63 TESTCASE(23,TestGreekMay);
73c04bcf
A
64 TESTCASE(24,TestGenericTime);
65 TESTCASE(25,TestGenericTimeZoneOrder);
46f4442e
A
66 TESTCASE(26,TestHost);
67 TESTCASE(27,TestEras);
68 TESTCASE(28,TestNarrowNames);
69 TESTCASE(29,TestStandAloneDays);
70 TESTCASE(30,TestStandAloneMonths);
71 TESTCASE(31,TestQuarters);
72 TESTCASE(32,TestZTimeZoneParsing);
73 TESTCASE(33,TestRelative);
74 TESTCASE(34,TestRelativeClone);
75 TESTCASE(35,TestHostClone);
76 TESTCASE(36,TestTimeZoneDisplayName);
77 /*
78 TESTCASE(37,TestRelativeError);
79 TESTCASE(38,TestRelativeOther);
7393aa2f
A
80 TESTCASE(39,TestNumberAsStringParsing);
81 */
82 TESTCASE(37,TestNumberAsStringParsing);
b75a7d8f
A
83 default: name = ""; break;
84 }
85}
86
87// Test written by Wally Wedel and emailed to me.
88void DateFormatTest::TestWallyWedel()
89{
90 UErrorCode status = U_ZERO_ERROR;
91 /*
92 * Instantiate a TimeZone so we can get the ids.
93 */
94 TimeZone *tz = new SimpleTimeZone(7,"");
95 /*
96 * Computational variables.
97 */
46f4442e 98 int32_t offset, hours, minutes, seconds;
b75a7d8f
A
99 /*
100 * Instantiate a SimpleDateFormat set up to produce a full time
101 zone name.
102 */
103 SimpleDateFormat *sdf = new SimpleDateFormat((UnicodeString)"zzzz", status);
104 /*
105 * A String array for the time zone ids.
106 */
107 int32_t ids_length;
108 StringEnumeration* ids = TimeZone::createEnumeration();
109 ids_length = ids->count(status);
110 /*
111 * How many ids do we have?
112 */
113 logln("Time Zone IDs size: %d", ids_length);
114 /*
115 * Column headings (sort of)
116 */
117 logln("Ordinal ID offset(h:m) name");
118 /*
119 * Loop through the tzs.
120 */
121 UDate today = Calendar::getNow();
122 Calendar *cal = Calendar::createInstance(status);
123 for (int32_t i = 0; i < ids_length; i++) {
124 // logln(i + " " + ids[i]);
125 const UnicodeString* id = ids->snext(status);
126 TimeZone *ttz = TimeZone::createTimeZone(*id);
127 // offset = ttz.getRawOffset();
128 cal->setTimeZone(*ttz);
129 cal->setTime(today, status);
130 offset = cal->get(UCAL_ZONE_OFFSET, status) + cal->get(UCAL_DST_OFFSET, status);
131 // logln(i + " " + ids[i] + " offset " + offset);
132 const char* sign = "+";
133 if (offset < 0) {
134 sign = "-";
135 offset = -offset;
136 }
137 hours = offset/3600000;
138 minutes = (offset%3600000)/60000;
46f4442e 139 seconds = (offset%60000)/1000;
b75a7d8f
A
140 UnicodeString dstOffset = (UnicodeString)"" + sign + (hours < 10 ? "0" : "") +
141 (int32_t)hours + ":" + (minutes < 10 ? "0" : "") + (int32_t)minutes;
46f4442e
A
142 if (seconds != 0) {
143 dstOffset = dstOffset + ":" + (seconds < 10 ? "0" : "") + seconds;
144 }
b75a7d8f
A
145 /*
146 * Instantiate a date so we can display the time zone name.
147 */
148 sdf->setTimeZone(*ttz);
149 /*
150 * Format the output.
151 */
152 UnicodeString fmtOffset;
153 FieldPosition pos(0);
154 sdf->format(today,fmtOffset, pos);
155 // UnicodeString fmtOffset = tzS.toString();
156 UnicodeString *fmtDstOffset = 0;
157 if (fmtOffset.startsWith("GMT"))
158 {
159 //fmtDstOffset = fmtOffset->substring(3);
160 fmtDstOffset = new UnicodeString();
161 fmtOffset.extract(3, fmtOffset.length(), *fmtDstOffset);
162 }
163 /*
164 * Show our result.
165 */
166 UBool ok = fmtDstOffset == 0 || *fmtDstOffset == dstOffset;
167 if (ok)
168 {
169 logln(UnicodeString() + i + " " + *id + " " + dstOffset +
170 " " + fmtOffset +
171 (fmtDstOffset != 0 ? " ok" : " ?"));
172 }
173 else
174 {
175 errln(UnicodeString() + i + " " + *id + " " + dstOffset +
176 " " + fmtOffset + " *** FAIL ***");
177 }
178 delete ttz;
179 delete fmtDstOffset;
180 }
181 delete cal;
182 // delete ids; // TODO: BAD API
183 delete ids;
184 delete sdf;
185 delete tz;
186}
187
188// -------------------------------------
189
190/**
191 * Test operator==
192 */
193void
194DateFormatTest::TestEquals()
195{
196 DateFormat* fmtA = DateFormat::createDateTimeInstance(DateFormat::MEDIUM, DateFormat::FULL);
197 DateFormat* fmtB = DateFormat::createDateTimeInstance(DateFormat::MEDIUM, DateFormat::FULL);
73c04bcf
A
198 if ( fmtA == NULL || fmtB == NULL){
199 dataerrln("Error calling DateFormat::createDateTimeInstance");
200 delete fmtA;
201 delete fmtB;
202 return;
203 }
204
b75a7d8f
A
205 if (!(*fmtA == *fmtB)) errln((UnicodeString)"FAIL");
206 delete fmtA;
207 delete fmtB;
73c04bcf
A
208
209 TimeZone* test = TimeZone::createTimeZone("PDT");
210 delete test;
b75a7d8f
A
211}
212
213// -------------------------------------
214
215/**
216 * Test the parsing of 2-digit years.
217 */
218void
219DateFormatTest::TestTwoDigitYearDSTParse(void)
220{
221 UErrorCode status = U_ZERO_ERROR;
222 SimpleDateFormat* fullFmt = new SimpleDateFormat((UnicodeString)"EEE MMM dd HH:mm:ss.SSS zzz yyyy G", status);
223 SimpleDateFormat *fmt = new SimpleDateFormat((UnicodeString)"dd-MMM-yy h:mm:ss 'o''clock' a z", Locale::getEnglish(), status);
224 //DateFormat* fmt = DateFormat::createDateTimeInstance(DateFormat::MEDIUM, DateFormat::FULL, Locale::ENGLISH);
225 UnicodeString* s = new UnicodeString("03-Apr-04 2:20:47 o'clock AM PST", "");
73c04bcf
A
226 TimeZone* defaultTZ = TimeZone::createDefault();
227 TimeZone* PST = TimeZone::createTimeZone("PST");
228 int32_t defaultOffset = defaultTZ->getRawOffset();
229 int32_t PSTOffset = PST->getRawOffset();
230 int32_t hour = 2 + (defaultOffset - PSTOffset) / (60*60*1000);
231 // hour is the expected hour of day, in units of seconds
232 hour = ((hour < 0) ? hour + 24 : hour) * 60*60;
233
b75a7d8f 234 UnicodeString str;
73c04bcf
A
235
236 if(U_FAILURE(status)) {
237 errln("Could not set up test. exitting");
238 return;
239 }
240
b75a7d8f
A
241 UDate d = fmt->parse(*s, status);
242 logln(*s + " P> " + ((DateFormat*)fullFmt)->format(d, str));
243 int32_t y, m, day, hr, min, sec;
244 dateToFields(d, y, m, day, hr, min, sec);
73c04bcf
A
245 hour += defaultTZ->inDaylightTime(d, status) ? 1 : 0;
246 hr = hr*60*60;
b75a7d8f 247 if (hr != hour)
73c04bcf 248 errln((UnicodeString)"FAIL: Should parse to hour " + hour + " but got " + hr);
b75a7d8f
A
249
250 if (U_FAILURE(status))
251 errln((UnicodeString)"FAIL: " + (int32_t)status);
252
253 delete s;
254 delete fmt;
255 delete fullFmt;
73c04bcf
A
256 delete PST;
257 delete defaultTZ;
b75a7d8f
A
258}
259
260// -------------------------------------
261
262UChar toHexString(int32_t i) { return (UChar)(i + (i < 10 ? 0x30 : (0x41 - 10))); }
263
264UnicodeString&
265DateFormatTest::escape(UnicodeString& s)
266{
267 UnicodeString buf;
268 for (int32_t i=0; i<s.length(); ++i)
269 {
270 UChar c = s[(int32_t)i];
271 if (c <= (UChar)0x7F) buf += c;
272 else {
273 buf += (UChar)0x5c; buf += (UChar)0x55;
274 buf += toHexString((c & 0xF000) >> 12);
275 buf += toHexString((c & 0x0F00) >> 8);
276 buf += toHexString((c & 0x00F0) >> 4);
277 buf += toHexString(c & 0x000F);
278 }
279 }
280 return (s = buf);
281}
282
b75a7d8f
A
283// -------------------------------------
284
374ca955
A
285/**
286 * This MUST be kept in sync with DateFormatSymbols.gPatternChars.
287 */
46f4442e 288static const char* PATTERN_CHARS = "GyMdkHmsSEDFwWahKzYeugAZvcLQqV";
374ca955
A
289
290/**
291 * A list of the names of all the fields in DateFormat.
292 * This MUST be kept in sync with DateFormat.
293 */
294static const char* DATEFORMAT_FIELD_NAMES[] = {
295 "ERA_FIELD",
296 "YEAR_FIELD",
297 "MONTH_FIELD",
298 "DATE_FIELD",
299 "HOUR_OF_DAY1_FIELD",
300 "HOUR_OF_DAY0_FIELD",
301 "MINUTE_FIELD",
302 "SECOND_FIELD",
303 "MILLISECOND_FIELD",
304 "DAY_OF_WEEK_FIELD",
305 "DAY_OF_YEAR_FIELD",
306 "DAY_OF_WEEK_IN_MONTH_FIELD",
307 "WEEK_OF_YEAR_FIELD",
308 "WEEK_OF_MONTH_FIELD",
309 "AM_PM_FIELD",
310 "HOUR1_FIELD",
311 "HOUR0_FIELD",
312 "TIMEZONE_FIELD",
313 "YEAR_WOY_FIELD",
314 "DOW_LOCAL_FIELD",
315 "EXTENDED_YEAR_FIELD",
316 "JULIAN_DAY_FIELD",
317 "MILLISECONDS_IN_DAY_FIELD",
73c04bcf
A
318 "TIMEZONE_RFC_FIELD",
319 "GENERIC_TIMEZONE_FIELD",
320 "STAND_ALONE_DAY_FIELD",
321 "STAND_ALONE_MONTH_FIELD",
322 "QUARTER_FIELD",
46f4442e
A
323 "STAND_ALONE_QUARTER_FIELD",
324 "TIMEZONE_SPECIAL_FIELD"
b75a7d8f
A
325};
326
374ca955
A
327static const int32_t DATEFORMAT_FIELD_NAMES_LENGTH =
328 sizeof(DATEFORMAT_FIELD_NAMES) / sizeof(DATEFORMAT_FIELD_NAMES[0]);
329
b75a7d8f
A
330/**
331 * Verify that returned field position indices are correct.
332 */
374ca955
A
333void DateFormatTest::TestFieldPosition() {
334 UErrorCode ec = U_ZERO_ERROR;
335 int32_t i, j, exp;
336 UnicodeString buf;
337
338 // Verify data
339 DateFormatSymbols rootSyms(Locale(""), ec);
340 assertSuccess("DateFormatSymbols", ec);
73c04bcf 341
46f4442e
A
342 // local pattern chars data is not longer loaded
343 // from icu locale bundle
344 assertEquals("patternChars", PATTERN_CHARS, rootSyms.getLocalPatternChars(buf));
374ca955
A
345 assertEquals("patternChars", PATTERN_CHARS, DateFormatSymbols::getPatternUChars());
346 assertTrue("DATEFORMAT_FIELD_NAMES", DATEFORMAT_FIELD_NAMES_LENGTH == UDAT_FIELD_COUNT);
347 assertTrue("Data", UDAT_FIELD_COUNT == uprv_strlen(PATTERN_CHARS));
348
349 // Create test formatters
350 const int32_t COUNT = 4;
351 DateFormat* dateFormats[COUNT];
352 dateFormats[0] = DateFormat::createDateTimeInstance(DateFormat::kFull, DateFormat::kFull, Locale::getUS());
353 dateFormats[1] = DateFormat::createDateTimeInstance(DateFormat::kFull, DateFormat::kFull, Locale::getFrance());
354 // Make the pattern "G y M d..."
355 buf.remove().append(PATTERN_CHARS);
356 for (j=buf.length()-1; j>=0; --j) buf.insert(j, (UChar)32/*' '*/);
357 dateFormats[2] = new SimpleDateFormat(buf, Locale::getUS(), ec);
358 // Make the pattern "GGGG yyyy MMMM dddd..."
359 for (j=buf.length()-1; j>=0; j-=2) {
360 for (i=0; i<3; ++i) {
361 buf.insert(j, buf.charAt(j));
362 }
363 }
364 dateFormats[3] = new SimpleDateFormat(buf, Locale::getUS(), ec);
73c04bcf
A
365 if(U_FAILURE(ec)){
366 errln(UnicodeString("Could not create SimpleDateFormat object for locale en_US. Error: " )+ UnicodeString(u_errorName(ec)));
367 return;
368 }
374ca955
A
369 UDate aug13 = 871508052513.0;
370
371 // Expected output field values for above DateFormats on aug13
372 // Fields are given in order of DateFormat field number
373 const char* EXPECTED[] = {
374 "", "1997", "August", "13", "", "", "34", "12", "",
46f4442e 375 "Wednesday", "", "", "", "", "PM", "2", "", "", "", "", "", "", "", "", "PT", "", "", "", "","",
374ca955 376
46f4442e
A
377 "", "1997", "ao\\u00FBt", "13", "", "14", "34", "12", "",
378 "mercredi", "", "", "", "", "", "", "", "", "", "", "", "", "", "", "\\u00C9tats-Unis (Los Angeles)", "", "", "", "", "",
374ca955
A
379
380 "AD", "1997", "8", "13", "14", "14", "34", "12", "5",
46f4442e 381 "Wed", "225", "2", "33", "3", "PM", "2", "2", "PDT", "1997", "4", "1997", "2450674", "52452513", "-0700", "PT", "4", "8", "3", "3","PDT",
b75a7d8f 382
73c04bcf 383 "Anno Domini", "1997", "August", "0013", "0014", "0014", "0034", "0012", "5130",
46f4442e
A
384 "Wednesday", "0225", "0002", "0033", "0003", "PM", "0002", "0002", "Pacific Daylight Time", "1997", "Wednesday", "1997", "2450674", "52452513", "GMT-07:00",
385 "Pacific Time", "Wednesday", "August", "3rd quarter", "3rd quarter", "United States (Los Angeles)"
b75a7d8f
A
386 };
387
374ca955 388 const int32_t EXPECTED_LENGTH = sizeof(EXPECTED)/sizeof(EXPECTED[0]);
b75a7d8f 389
374ca955
A
390 assertTrue("data size", EXPECTED_LENGTH == COUNT * UDAT_FIELD_COUNT);
391
392 TimeZone* PT = TimeZone::createTimeZone("America/Los_Angeles");
393 for (j = 0, exp = 0; j < COUNT; ++j) {
394 // String str;
b75a7d8f 395 DateFormat* df = dateFormats[j];
374ca955
A
396 df->setTimeZone(*PT);
397 if (df->getDynamicClassID() == SimpleDateFormat::getStaticClassID()) {
398 logln(" Pattern = " + ((SimpleDateFormat*) df)->toPattern(buf.remove()));
399 } else {
400 logln(" Pattern = ? (not a SimpleDateFormat)");
401 }
402 logln((UnicodeString)" Result = " + df->format(aug13, buf.remove()));
403
404 for (i = 0; i < UDAT_FIELD_COUNT; ++i, ++exp) {
405 FieldPosition pos(i);
73c04bcf
A
406 buf.remove();
407 df->format(aug13, buf, pos);
b75a7d8f 408 UnicodeString field;
374ca955
A
409 buf.extractBetween(pos.getBeginIndex(), pos.getEndIndex(), field);
410 assertEquals((UnicodeString)"field #" + i + " " + DATEFORMAT_FIELD_NAMES[i],
411 ctou(EXPECTED[exp]), field);
b75a7d8f
A
412 }
413 }
374ca955
A
414
415 for (i=0; i<COUNT; ++i) {
416 delete dateFormats[i];
417 }
418 delete PT;
b75a7d8f 419}
374ca955 420
b75a7d8f 421// -------------------------------------
374ca955
A
422
423/**
424 * General parse/format tests. Add test cases as needed.
425 */
426void DateFormatTest::TestGeneral() {
427 const char* DATA[] = {
428 "yyyy MM dd HH:mm:ss.SSS",
429
430 // Milliseconds are left-justified, since they format as fractions of a second
431 "y/M/d H:mm:ss.S", "fp", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.6", "2004 03 10 16:36:31.600",
432 "y/M/d H:mm:ss.SS", "fp", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.57", "2004 03 10 16:36:31.570",
433 "y/M/d H:mm:ss.SSS", "F", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.567",
434 "y/M/d H:mm:ss.SSSS", "pf", "2004/3/10 16:36:31.5679", "2004 03 10 16:36:31.568", "2004/3/10 16:36:31.5680",
435 };
73c04bcf 436 expect(DATA, ARRAY_SIZE(DATA), Locale("en", "", ""));
b75a7d8f
A
437}
438
439// -------------------------------------
440
441/**
442 * Verify that strings which contain incomplete specifications are parsed
443 * correctly. In some instances, this means not being parsed at all, and
444 * returning an appropriate error.
445 */
446void
447DateFormatTest::TestPartialParse994()
448{
449 UErrorCode status = U_ZERO_ERROR;
450 SimpleDateFormat* f = new SimpleDateFormat(status);
73c04bcf 451 ASSERT_OK(status);
b75a7d8f
A
452 UDate null = 0;
453 tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 10:11:42", date(97, 1 - 1, 17, 10, 11, 42));
454 tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 10:", null);
455 tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 10", null);
456 tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17 ", null);
457 tryPat994(f, "yy/MM/dd HH:mm:ss", "97/01/17", null);
458 if (U_FAILURE(status)) errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
459 delete f;
460}
461
462// -------------------------------------
463
464void
465DateFormatTest::tryPat994(SimpleDateFormat* format, const char* pat, const char* str, UDate expected)
466{
467 UErrorCode status = U_ZERO_ERROR;
468 UDate null = 0;
469 logln(UnicodeString("Pattern \"") + pat + "\" String \"" + str + "\"");
470 //try {
471 format->applyPattern(pat);
472 UDate date = format->parse(str, status);
473 if (U_FAILURE(status) || date == null)
474 {
475 logln((UnicodeString)"ParseException: " + (int32_t)status);
476 if (expected != null) errln((UnicodeString)"FAIL: Expected " + dateToString(expected));
477 }
478 else
479 {
480 UnicodeString f;
481 ((DateFormat*)format)->format(date, f);
482 logln(UnicodeString(" parse(") + str + ") -> " + dateToString(date));
483 logln((UnicodeString)" format -> " + f);
484 if (expected == null ||
485 !(date == expected)) errln((UnicodeString)"FAIL: Expected null");//" + expected);
486 if (!(f == str)) errln(UnicodeString("FAIL: Expected ") + str);
487 }
488 //}
489 //catch(ParseException e) {
490 // logln((UnicodeString)"ParseException: " + e.getMessage());
491 // if (expected != null) errln((UnicodeString)"FAIL: Expected " + dateToString(expected));
492 //}
493 //catch(Exception e) {
494 // errln((UnicodeString)"*** Exception:");
495 // e.printStackTrace();
496 //}
497}
498
499// -------------------------------------
500
501/**
502 * Verify the behavior of patterns in which digits for different fields run together
503 * without intervening separators.
504 */
505void
506DateFormatTest::TestRunTogetherPattern985()
507{
508 UErrorCode status = U_ZERO_ERROR;
509 UnicodeString format("yyyyMMddHHmmssSSS");
510 UnicodeString now, then;
511 //UBool flag;
512 SimpleDateFormat *formatter = new SimpleDateFormat(format, status);
73c04bcf 513 ASSERT_OK(status);
b75a7d8f
A
514 UDate date1 = Calendar::getNow();
515 ((DateFormat*)formatter)->format(date1, now);
516 logln(now);
517 ParsePosition pos(0);
518 UDate date2 = formatter->parse(now, pos);
519 if (date2 == 0) then = "Parse stopped at " + pos.getIndex();
520 else ((DateFormat*)formatter)->format(date2, then);
521 logln(then);
522 if (!(date2 == date1)) errln((UnicodeString)"FAIL");
523 delete formatter;
524 if (U_FAILURE(status)) errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
525}
526
527// -------------------------------------
528
529/**
530 * Verify the behavior of patterns in which digits for different fields run together
531 * without intervening separators.
532 */
533void
534DateFormatTest::TestRunTogetherPattern917()
535{
536 UErrorCode status = U_ZERO_ERROR;
537 SimpleDateFormat* fmt;
538 UnicodeString myDate;
539 fmt = new SimpleDateFormat((UnicodeString)"yyyy/MM/dd", status);
73c04bcf 540 ASSERT_OK(status);
b75a7d8f
A
541 myDate = "1997/02/03";
542 testIt917(fmt, myDate, date(97, 2 - 1, 3));
543 delete fmt;
544 fmt = new SimpleDateFormat((UnicodeString)"yyyyMMdd", status);
545 myDate = "19970304";
546 testIt917(fmt, myDate, date(97, 3 - 1, 4));
547 delete fmt;
548 if (U_FAILURE(status)) errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
549}
550
551// -------------------------------------
552
553void
554DateFormatTest::testIt917(SimpleDateFormat* fmt, UnicodeString& str, UDate expected)
555{
556 UErrorCode status = U_ZERO_ERROR;
557 UnicodeString pattern;
558 logln((UnicodeString)"pattern=" + fmt->toPattern(pattern) + " string=" + str);
559 Formattable o;
560 //try {
561 ((Format*)fmt)->parseObject(str, o, status);
562 //}
563 if (U_FAILURE(status)) return;
564 //catch(ParseException e) {
565 // e.printStackTrace();
566 // return;
567 //}
568 logln((UnicodeString)"Parsed object: " + dateToString(o.getDate()));
569 if (!(o.getDate() == expected)) errln((UnicodeString)"FAIL: Expected " + dateToString(expected));
570 UnicodeString formatted; ((Format*)fmt)->format(o, formatted, status);
571 logln((UnicodeString)"Formatted string: " + formatted);
572 if (!(formatted == str)) errln((UnicodeString)"FAIL: Expected " + str);
573 if (U_FAILURE(status)) errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
574}
575
576// -------------------------------------
577
578/**
579 * Verify the handling of Czech June and July, which have the unique attribute that
580 * one is a proper prefix substring of the other.
581 */
582void
583DateFormatTest::TestCzechMonths459()
584{
585 UErrorCode status = U_ZERO_ERROR;
586 DateFormat* fmt = DateFormat::createDateInstance(DateFormat::FULL, Locale("cs", "", ""));
73c04bcf
A
587 if (fmt == NULL){
588 dataerrln("Error calling DateFormat::createDateInstance()");
589 return;
590 }
591
b75a7d8f
A
592 UnicodeString pattern;
593 logln((UnicodeString)"Pattern " + ((SimpleDateFormat*) fmt)->toPattern(pattern));
594 UDate june = date(97, UCAL_JUNE, 15);
595 UDate july = date(97, UCAL_JULY, 15);
596 UnicodeString juneStr; fmt->format(june, juneStr);
597 UnicodeString julyStr; fmt->format(july, julyStr);
598 //try {
599 logln((UnicodeString)"format(June 15 1997) = " + juneStr);
600 UDate d = fmt->parse(juneStr, status);
601 UnicodeString s; fmt->format(d, s);
602 int32_t month,yr,day,hr,min,sec; dateToFields(d,yr,month,day,hr,min,sec);
603 logln((UnicodeString)" -> parse -> " + s + " (month = " + month + ")");
604 if (month != UCAL_JUNE) errln((UnicodeString)"FAIL: Month should be June");
605 logln((UnicodeString)"format(July 15 1997) = " + julyStr);
606 d = fmt->parse(julyStr, status);
607 fmt->format(d, s);
608 dateToFields(d,yr,month,day,hr,min,sec);
609 logln((UnicodeString)" -> parse -> " + s + " (month = " + month + ")");
610 if (month != UCAL_JULY) errln((UnicodeString)"FAIL: Month should be July");
611 //}
612 //catch(ParseException e) {
613 if (U_FAILURE(status))
614 errln((UnicodeString)"Exception: " + (int32_t)status);
615 //}
616 delete fmt;
617}
618
619// -------------------------------------
620
621/**
622 * Test the handling of 'D' in patterns.
623 */
624void
625DateFormatTest::TestLetterDPattern212()
626{
627 UErrorCode status = U_ZERO_ERROR;
628 UnicodeString dateString("1995-040.05:01:29");
46f4442e 629 UnicodeString ddateString("1995-02-09.05:01:29");
b75a7d8f 630 UnicodeString bigD("yyyy-DDD.hh:mm:ss");
46f4442e 631 UnicodeString littleD("yyyy-MM-dd.hh:mm:ss");
b75a7d8f
A
632 UDate expLittleD = date(95, 0, 1, 5, 1, 29);
633 UDate expBigD = expLittleD + 39 * 24 * 3600000.0;
634 expLittleD = expBigD; // Expect the same, with default lenient parsing
635 logln((UnicodeString)"dateString= " + dateString);
636 SimpleDateFormat *formatter = new SimpleDateFormat(bigD, status);
73c04bcf 637 ASSERT_OK(status);
b75a7d8f
A
638 ParsePosition pos(0);
639 UDate myDate = formatter->parse(dateString, pos);
640 logln((UnicodeString)"Using " + bigD + " -> " + myDate);
46f4442e 641 if (myDate != expBigD) errln((UnicodeString)"FAIL: bigD - Expected " + dateToString(expBigD));
b75a7d8f
A
642 delete formatter;
643 formatter = new SimpleDateFormat(littleD, status);
73c04bcf 644 ASSERT_OK(status);
b75a7d8f 645 pos = ParsePosition(0);
46f4442e 646 myDate = formatter->parse(ddateString, pos);
b75a7d8f 647 logln((UnicodeString)"Using " + littleD + " -> " + dateToString(myDate));
46f4442e 648 if (myDate != expLittleD) errln((UnicodeString)"FAIL: littleD - Expected " + dateToString(expLittleD));
b75a7d8f
A
649 delete formatter;
650 if (U_FAILURE(status)) errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
651}
652
653// -------------------------------------
654
655/**
656 * Test the day of year pattern.
657 */
658void
659DateFormatTest::TestDayOfYearPattern195()
660{
661 UErrorCode status = U_ZERO_ERROR;
662 UDate today = Calendar::getNow();
663 int32_t year,month,day,hour,min,sec; dateToFields(today,year,month,day,hour,min,sec);
664 UDate expected = date(year, month, day);
665 logln((UnicodeString)"Test Date: " + dateToString(today));
666 SimpleDateFormat* sdf = (SimpleDateFormat*)DateFormat::createDateInstance();
73c04bcf
A
667 if (sdf == NULL){
668 dataerrln("Error calling DateFormat::createDateInstance()");
669 return;
670 }
b75a7d8f
A
671 tryPattern(*sdf, today, 0, expected);
672 tryPattern(*sdf, today, "G yyyy DDD", expected);
673 delete sdf;
674 if (U_FAILURE(status)) errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
675}
676
677// -------------------------------------
678
679void
680DateFormatTest::tryPattern(SimpleDateFormat& sdf, UDate d, const char* pattern, UDate expected)
681{
682 UErrorCode status = U_ZERO_ERROR;
683 if (pattern != 0) sdf.applyPattern(pattern);
684 UnicodeString thePat;
685 logln((UnicodeString)"pattern: " + sdf.toPattern(thePat));
686 UnicodeString formatResult; (*(DateFormat*)&sdf).format(d, formatResult);
687 logln((UnicodeString)" format -> " + formatResult);
688 // try {
689 UDate d2 = sdf.parse(formatResult, status);
690 logln((UnicodeString)" parse(" + formatResult + ") -> " + dateToString(d2));
691 if (d2 != expected) errln((UnicodeString)"FAIL: Expected " + dateToString(expected));
692 UnicodeString format2; (*(DateFormat*)&sdf).format(d2, format2);
693 logln((UnicodeString)" format -> " + format2);
694 if (!(formatResult == format2)) errln((UnicodeString)"FAIL: Round trip drift");
695 //}
696 //catch(Exception e) {
697 if (U_FAILURE(status))
698 errln((UnicodeString)"Error: " + (int32_t)status);
699 //}
700}
701
702// -------------------------------------
703
704/**
705 * Test the handling of single quotes in patterns.
706 */
707void
708DateFormatTest::TestQuotePattern161()
709{
710 UErrorCode status = U_ZERO_ERROR;
711 SimpleDateFormat* formatter = new SimpleDateFormat((UnicodeString)"MM/dd/yyyy 'at' hh:mm:ss a zzz", status);
73c04bcf 712 ASSERT_OK(status);
b75a7d8f
A
713 UDate currentTime_1 = date(97, UCAL_AUGUST, 13, 10, 42, 28);
714 UnicodeString dateString; ((DateFormat*)formatter)->format(currentTime_1, dateString);
715 UnicodeString exp("08/13/1997 at 10:42:28 AM ");
716 logln((UnicodeString)"format(" + dateToString(currentTime_1) + ") = " + dateString);
717 if (0 != dateString.compareBetween(0, exp.length(), exp, 0, exp.length())) errln((UnicodeString)"FAIL: Expected " + exp);
718 delete formatter;
719 if (U_FAILURE(status)) errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
720}
721
722// -------------------------------------
723
724/**
725 * Verify the correct behavior when handling invalid input strings.
726 */
727void
728DateFormatTest::TestBadInput135()
729{
730 UErrorCode status = U_ZERO_ERROR;
731 DateFormat::EStyle looks[] = {
732 DateFormat::SHORT, DateFormat::MEDIUM, DateFormat::LONG, DateFormat::FULL
733 };
734 int32_t looks_length = (int32_t)(sizeof(looks) / sizeof(looks[0]));
735 const char* strings[] = {
736 "Mar 15", "Mar 15 1997", "asdf", "3/1/97 1:23:", "3/1/00 1:23:45 AM"
737 };
738 int32_t strings_length = (int32_t)(sizeof(strings) / sizeof(strings[0]));
739 DateFormat *full = DateFormat::createDateTimeInstance(DateFormat::LONG, DateFormat::LONG);
73c04bcf
A
740 if(full==NULL) {
741 errln("could not create date time instance");
742 return;
743 }
b75a7d8f
A
744 UnicodeString expected("March 1, 2000 1:23:45 AM ");
745 for (int32_t i = 0; i < strings_length;++i) {
746 const char* text = strings[i];
747 for (int32_t j = 0; j < looks_length;++j) {
748 DateFormat::EStyle dateLook = looks[j];
749 for (int32_t k = 0; k < looks_length;++k) {
750 DateFormat::EStyle timeLook = looks[k];
751 DateFormat *df = DateFormat::createDateTimeInstance(dateLook, timeLook);
73c04bcf
A
752 if (df == NULL){
753 dataerrln("Error calling DateFormat::createDateTimeInstance()");
754 continue;
755 }
b75a7d8f
A
756 UnicodeString prefix = UnicodeString(text) + ", " + dateLook + "/" + timeLook + ": ";
757 //try {
758 UDate when = df->parse(text, status);
759 if (when == 0 && U_SUCCESS(status)) {
760 errln(prefix + "SHOULD NOT HAPPEN: parse returned 0.");
761 continue;
762 }
763 if (U_SUCCESS(status))
764 {
765 UnicodeString format;
766 full->format(when, format);
767 logln(prefix + "OK: " + format);
768 if (0!=format.compareBetween(0, expected.length(), expected, 0, expected.length()))
769 errln((UnicodeString)"FAIL: Expected " + expected + " got " + format);
770 }
771 //}
772 //catch(ParseException e) {
773 else
774 status = U_ZERO_ERROR;
775 //}
776 //catch(StringIndexOutOfBoundsException e) {
777 // errln(prefix + "SHOULD NOT HAPPEN: " + (int)status);
778 //}
779 delete df;
780 }
781 }
782 }
783 delete full;
784 if (U_FAILURE(status))
785 errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
786}
787
46f4442e 788static const char* const parseFormats[] = {
b75a7d8f
A
789 "MMMM d, yyyy",
790 "MMMM d yyyy",
791 "M/d/yy",
792 "d MMMM, yyyy",
793 "d MMMM yyyy",
794 "d MMMM",
795 "MMMM d",
796 "yyyy",
797 "h:mm a MMMM d, yyyy"
798};
799
46f4442e
A
800#if 0
801// strict inputStrings
802static const char* const inputStrings[] = {
b75a7d8f
A
803 "bogus string", 0, 0, 0, 0, 0, 0, 0, 0, 0,
804 "April 1, 1997", "April 1, 1997", 0, 0, 0, 0, 0, "April 1", 0, 0,
805 "Jan 1, 1970", "January 1, 1970", 0, 0, 0, 0, 0, "January 1", 0, 0,
806 "Jan 1 2037", 0, "January 1 2037", 0, 0, 0, 0, "January 1", 0, 0,
807 "1/1/70", 0, 0, "1/1/70", 0, 0, 0, 0, "0001", 0,
808 "5 May 1997", 0, 0, 0, 0, "5 May 1997", "5 May", 0, "0005", 0,
809 "16 May", 0, 0, 0, 0, 0, "16 May", 0, "0016", 0,
810 "April 30", 0, 0, 0, 0, 0, 0, "April 30", 0, 0,
811 "1998", 0, 0, 0, 0, 0, 0, 0, "1998", 0,
812 "1", 0, 0, 0, 0, 0, 0, 0, "0001", 0,
813 "3:00 pm Jan 1, 1997", 0, 0, 0, 0, 0, 0, 0, "0003", "3:00 PM January 1, 1997",
814};
46f4442e
A
815#else
816// lenient inputStrings
817static const char* const inputStrings[] = {
818 "bogus string", 0, 0, 0, 0, 0, 0, 0, 0, 0,
819 "April 1, 1997", "April 1, 1997", "April 1 1997", "4/1/97", 0, 0, 0, "April 1", 0, 0,
820 "Jan 1, 1970", "January 1, 1970", "January 1 1970", "1/1/70", 0, 0, 0, "January 1", 0, 0,
821 "Jan 1 2037", "January 1, 2037", "January 1 2037", "1/1/37", 0, 0, 0, "January 1", 0, 0,
822 "1/1/70", "January 1, 1970", "January 1 1970", "1/1/70", "1 January, 1970", "1 January 1970", "1 January", "January 1", "0001", 0,
823 "5 May 1997", 0, 0, 0, "5 May, 1997", "5 May 1997", "5 May", 0, "0005", 0,
824 "16 May", 0, 0, 0, 0, 0, "16 May", 0, "2016", 0,
825 "April 30", 0, 0, 0, 0, 0, 0, "April 30", 0, 0,
826 "1998", 0, 0, 0, 0, 0, 0, 0, "1998", 0,
827 "1", 0, 0, 0, 0, 0, 0, 0, "0001", 0,
828 "3:00 pm Jan 1, 1997", 0, 0, 0, 0, 0, 0, 0, "0003", "3:00 PM January 1, 1997",
829};
830#endif
831
b75a7d8f
A
832// -------------------------------------
833
834/**
835 * Verify the correct behavior when parsing an array of inputs against an
836 * array of patterns, with known results. The results are encoded after
837 * the input strings in each row.
838 */
839void
840DateFormatTest::TestBadInput135a()
841{
842 UErrorCode status = U_ZERO_ERROR;
843 SimpleDateFormat* dateParse = new SimpleDateFormat(status);
844 if(U_FAILURE(status)) {
845 errln("Failed creating SimpleDateFormat with %s. Quitting test", u_errorName(status));
846 delete dateParse;
847 return;
848 }
849 const char* s;
850 UDate date;
851 const uint32_t PF_LENGTH = (int32_t)(sizeof(parseFormats)/sizeof(parseFormats[0]));
852 const uint32_t INPUT_LENGTH = (int32_t)(sizeof(inputStrings)/sizeof(inputStrings[0]));
853
854 dateParse->applyPattern("d MMMM, yyyy");
855 dateParse->adoptTimeZone(TimeZone::createDefault());
856 s = "not parseable";
857 UnicodeString thePat;
858 logln(UnicodeString("Trying to parse \"") + s + "\" with " + dateParse->toPattern(thePat));
859 //try {
860 date = dateParse->parse(s, status);
861 if (U_SUCCESS(status))
862 errln((UnicodeString)"FAIL: Expected exception during parse");
863 //}
864 //catch(Exception ex) {
865 else
866 logln((UnicodeString)"Exception during parse: " + (int32_t)status);
867 status = U_ZERO_ERROR;
868 //}
869 for (uint32_t i = 0; i < INPUT_LENGTH; i += (PF_LENGTH + 1)) {
870 ParsePosition parsePosition(0);
871 UnicodeString s( inputStrings[i]);
872 for (uint32_t index = 0; index < PF_LENGTH;++index) {
873 const char* expected = inputStrings[i + 1 + index];
874 dateParse->applyPattern(parseFormats[index]);
875 dateParse->adoptTimeZone(TimeZone::createDefault());
876 //try {
877 parsePosition.setIndex(0);
878 date = dateParse->parse(s, parsePosition);
879 if (parsePosition.getIndex() != 0) {
880 UnicodeString s1, s2;
881 s.extract(0, parsePosition.getIndex(), s1);
882 s.extract(parsePosition.getIndex(), s.length(), s2);
883 if (date == 0) {
884 errln((UnicodeString)"ERROR: null result fmt=\"" +
885 parseFormats[index] +
886 "\" pos=" + parsePosition.getIndex() + " " +
887 s1 + "|" + s2);
888 }
889 else {
890 UnicodeString result;
891 ((DateFormat*)dateParse)->format(date, result);
892 logln((UnicodeString)"Parsed \"" + s + "\" using \"" + dateParse->toPattern(thePat) + "\" to: " + result);
893 if (expected == 0)
46f4442e 894 errln((UnicodeString)"FAIL: Expected parse failure, got " + result);
b75a7d8f 895 else if (!(result == expected))
46f4442e 896 errln(UnicodeString("FAIL: Expected ") + expected + UnicodeString(", got ") + result);
b75a7d8f
A
897 }
898 }
899 else if (expected != 0) {
900 errln(UnicodeString("FAIL: Expected ") + expected + " from \"" +
901 s + "\" with \"" + dateParse->toPattern(thePat) + "\"");
902 }
903 //}
904 //catch(Exception ex) {
905 if (U_FAILURE(status))
906 errln((UnicodeString)"An exception was thrown during parse: " + (int32_t)status);
907 //}
908 }
909 }
910 delete dateParse;
911 if (U_FAILURE(status))
912 errln((UnicodeString)"FAIL: UErrorCode received during test: " + (int32_t)status);
913}
914
915// -------------------------------------
916
917/**
918 * Test the parsing of two-digit years.
919 */
920void
921DateFormatTest::TestTwoDigitYear()
922{
923 UErrorCode ec = U_ZERO_ERROR;
924 SimpleDateFormat fmt("dd/MM/yy", Locale::getUK(), ec);
925 if (U_FAILURE(ec)) {
926 errln("FAIL: SimpleDateFormat constructor");
927 return;
928 }
929 parse2DigitYear(fmt, "5/6/17", date(117, UCAL_JUNE, 5));
930 parse2DigitYear(fmt, "4/6/34", date(34, UCAL_JUNE, 4));
931}
932
933// -------------------------------------
934
935void
936DateFormatTest::parse2DigitYear(DateFormat& fmt, const char* str, UDate expected)
937{
938 UErrorCode status = U_ZERO_ERROR;
939 //try {
940 UDate d = fmt.parse(str, status);
941 UnicodeString thePat;
942 logln(UnicodeString("Parsing \"") + str + "\" with " + ((SimpleDateFormat*)&fmt)->toPattern(thePat) +
943 " => " + dateToString(d));
944 if (d != expected) errln((UnicodeString)"FAIL: Expected " + expected);
945 //}
946 //catch(ParseException e) {
947 if (U_FAILURE(status))
948 errln((UnicodeString)"FAIL: Got exception");
949 //}
950}
951
952// -------------------------------------
953
954/**
955 * Test the formatting of time zones.
956 */
957void
958DateFormatTest::TestDateFormatZone061()
959{
960 UErrorCode status = U_ZERO_ERROR;
961 UDate date;
962 DateFormat *formatter;
963 date= 859248000000.0;
964 logln((UnicodeString)"Date 1997/3/25 00:00 GMT: " + date);
965 formatter = new SimpleDateFormat((UnicodeString)"dd-MMM-yyyyy HH:mm", Locale::getUK(), status);
966 if(U_FAILURE(status)) {
967 errln("Failed creating SimpleDateFormat with %s. Quitting test", u_errorName(status));
968 delete formatter;
969 return;
970 }
971 formatter->adoptTimeZone(TimeZone::createTimeZone("GMT"));
972 UnicodeString temp; formatter->format(date, temp);
973 logln((UnicodeString)"Formatted in GMT to: " + temp);
974 //try {
975 UDate tempDate = formatter->parse(temp, status);
976 logln((UnicodeString)"Parsed to: " + dateToString(tempDate));
977 if (tempDate != date) errln((UnicodeString)"FAIL: Expected " + dateToString(date));
978 //}
979 //catch(Throwable t) {
980 if (U_FAILURE(status))
981 errln((UnicodeString)"Date Formatter throws: " + (int32_t)status);
982 //}
983 delete formatter;
984}
985
986// -------------------------------------
987
988/**
989 * Test the formatting of time zones.
990 */
991void
992DateFormatTest::TestDateFormatZone146()
993{
994 TimeZone *saveDefault = TimeZone::createDefault();
995
996 //try {
997 TimeZone *thedefault = TimeZone::createTimeZone("GMT");
998 TimeZone::setDefault(*thedefault);
999 // java.util.Locale.setDefault(new java.util.Locale("ar", "", ""));
1000
1001 // check to be sure... its GMT all right
1002 TimeZone *testdefault = TimeZone::createDefault();
1003 UnicodeString testtimezone;
1004 testdefault->getID(testtimezone);
1005 if (testtimezone == "GMT")
1006 logln("Test timezone = " + testtimezone);
1007 else
1008 errln("Test timezone should be GMT, not " + testtimezone);
1009
1010 UErrorCode status = U_ZERO_ERROR;
1011 // now try to use the default GMT time zone
1012 GregorianCalendar *greenwichcalendar =
1013 new GregorianCalendar(1997, 3, 4, 23, 0, status);
1014 failure(status, "new GregorianCalendar");
1015 //*****************************greenwichcalendar.setTimeZone(TimeZone.getDefault());
1016 //greenwichcalendar.set(1997, 3, 4, 23, 0);
1017 // try anything to set hour to 23:00 !!!
1018 greenwichcalendar->set(UCAL_HOUR_OF_DAY, 23);
1019 // get time
1020 UDate greenwichdate = greenwichcalendar->getTime(status);
1021 // format every way
1022 UnicodeString DATA [] = {
73c04bcf 1023 UnicodeString("simple format: "), UnicodeString("04/04/97 23:00 GMT+00:00"),
b75a7d8f 1024 UnicodeString("MM/dd/yy HH:mm z"),
73c04bcf 1025 UnicodeString("full format: "), UnicodeString("Friday, April 4, 1997 11:00:00 o'clock PM GMT+00:00"),
b75a7d8f 1026 UnicodeString("EEEE, MMMM d, yyyy h:mm:ss 'o''clock' a z"),
73c04bcf 1027 UnicodeString("long format: "), UnicodeString("April 4, 1997 11:00:00 PM GMT+00:00"),
b75a7d8f
A
1028 UnicodeString("MMMM d, yyyy h:mm:ss a z"),
1029 UnicodeString("default format: "), UnicodeString("04-Apr-97 11:00:00 PM"),
1030 UnicodeString("dd-MMM-yy h:mm:ss a"),
1031 UnicodeString("short format: "), UnicodeString("4/4/97 11:00 PM"),
1032 UnicodeString("M/d/yy h:mm a")
1033 };
1034 int32_t DATA_length = (int32_t)(sizeof(DATA) / sizeof(DATA[0]));
1035
1036 for (int32_t i=0; i<DATA_length; i+=3) {
1037 DateFormat *fmt = new SimpleDateFormat(DATA[i+2], Locale::getEnglish(), status);
1038 if(failure(status, "new SimpleDateFormat")) break;
1039 fmt->setCalendar(*greenwichcalendar);
1040 UnicodeString result;
1041 result = fmt->format(greenwichdate, result);
1042 logln(DATA[i] + result);
1043 if (result != DATA[i+1])
1044 errln("FAIL: Expected " + DATA[i+1] + ", got " + result);
1045 delete fmt;
1046 }
1047 //}
1048 //finally {
1049 TimeZone::adoptDefault(saveDefault);
1050 //}
1051 delete testdefault;
1052 delete greenwichcalendar;
1053 delete thedefault;
1054
1055
1056}
1057
1058// -------------------------------------
1059
1060/**
1061 * Test the formatting of dates in different locales.
1062 */
1063void
1064DateFormatTest::TestLocaleDateFormat() // Bug 495
1065{
1066 UDate testDate = date(97, UCAL_SEPTEMBER, 15);
1067 DateFormat *dfFrench = DateFormat::createDateTimeInstance(DateFormat::FULL,
1068 DateFormat::FULL, Locale::getFrench());
1069 DateFormat *dfUS = DateFormat::createDateTimeInstance(DateFormat::FULL,
1070 DateFormat::FULL, Locale::getUS());
46f4442e 1071 UnicodeString expectedFRENCH ( "lundi 15 septembre 1997 00:00:00 \\u00C9tats-Unis (Los Angeles)", -1, US_INV );
374ca955 1072 expectedFRENCH = expectedFRENCH.unescape();
b75a7d8f 1073 //UnicodeString expectedUS ( "Monday, September 15, 1997 12:00:00 o'clock AM PDT" );
73c04bcf 1074 UnicodeString expectedUS ( "Monday, September 15, 1997 12:00:00 AM PT" );
b75a7d8f
A
1075 logln((UnicodeString)"Date set to : " + dateToString(testDate));
1076 UnicodeString out;
73c04bcf
A
1077 if (dfUS == NULL || dfFrench == NULL){
1078 dataerrln("Error calling DateFormat::createDateTimeInstance)");
1079 delete dfUS;
1080 delete dfFrench;
1081 return;
1082 }
1083
b75a7d8f
A
1084 dfFrench->format(testDate, out);
1085 logln((UnicodeString)"Date Formated with French Locale " + out);
1086 if (!(out == expectedFRENCH))
1087 errln((UnicodeString)"FAIL: Expected " + expectedFRENCH);
1088 out.truncate(0);
1089 dfUS->format(testDate, out);
1090 logln((UnicodeString)"Date Formated with US Locale " + out);
1091 if (!(out == expectedUS))
1092 errln((UnicodeString)"FAIL: Expected " + expectedUS);
1093 delete dfUS;
1094 delete dfFrench;
1095}
1096
1097/**
1098 * Test DateFormat(Calendar) API
1099 */
1100void DateFormatTest::TestDateFormatCalendar() {
1101 DateFormat *date=0, *time=0, *full=0;
1102 Calendar *cal=0;
1103 UnicodeString str;
1104 ParsePosition pos;
1105 UDate when;
1106 UErrorCode ec = U_ZERO_ERROR;
1107
1108 /* Create a formatter for date fields. */
1109 date = DateFormat::createDateInstance(DateFormat::kShort, Locale::getUS());
1110 if (date == NULL) {
1111 errln("FAIL: createDateInstance failed");
1112 goto FAIL;
1113 }
1114
1115 /* Create a formatter for time fields. */
1116 time = DateFormat::createTimeInstance(DateFormat::kShort, Locale::getUS());
1117 if (time == NULL) {
1118 errln("FAIL: createTimeInstance failed");
1119 goto FAIL;
1120 }
1121
1122 /* Create a full format for output */
1123 full = DateFormat::createDateTimeInstance(DateFormat::kFull, DateFormat::kFull,
1124 Locale::getUS());
1125 if (full == NULL) {
1126 errln("FAIL: createInstance failed");
1127 goto FAIL;
1128 }
1129
1130 /* Create a calendar */
1131 cal = Calendar::createInstance(Locale::getUS(), ec);
1132 if (cal == NULL || U_FAILURE(ec)) {
1133 errln((UnicodeString)"FAIL: Calendar::createInstance failed with " +
1134 u_errorName(ec));
1135 goto FAIL;
1136 }
1137
1138 /* Parse the date */
1139 cal->clear();
1140 str = UnicodeString("4/5/2001", "");
1141 pos.setIndex(0);
1142 date->parse(str, *cal, pos);
1143 if (pos.getIndex() != str.length()) {
1144 errln((UnicodeString)"FAIL: DateFormat::parse(4/5/2001) failed at " +
1145 pos.getIndex());
1146 goto FAIL;
1147 }
1148
1149 /* Parse the time */
1150 str = UnicodeString("5:45 PM", "");
1151 pos.setIndex(0);
1152 time->parse(str, *cal, pos);
1153 if (pos.getIndex() != str.length()) {
1154 errln((UnicodeString)"FAIL: DateFormat::parse(17:45) failed at " +
1155 pos.getIndex());
1156 goto FAIL;
1157 }
1158
1159 /* Check result */
1160 when = cal->getTime(ec);
1161 if (U_FAILURE(ec)) {
1162 errln((UnicodeString)"FAIL: cal->getTime() failed with " + u_errorName(ec));
1163 goto FAIL;
1164 }
1165 str.truncate(0);
1166 full->format(when, str);
1167 // Thursday, April 5, 2001 5:45:00 PM PDT 986517900000
1168 if (when == 986517900000.0) {
1169 logln("Ok: Parsed result: " + str);
1170 } else {
1171 errln("FAIL: Parsed result: " + str + ", exp 4/5/2001 5:45 PM");
1172 }
1173
1174 FAIL:
1175 delete date;
1176 delete time;
1177 delete full;
1178 delete cal;
1179}
1180
1181/**
1182 * Test DateFormat's parsing of space characters. See jitterbug 1916.
1183 */
1184void DateFormatTest::TestSpaceParsing() {
1185 const char* DATA[] = {
1186 "yyyy MM dd HH:mm:ss",
1187
1188 // pattern, input, expected parse or NULL if expect parse failure
46f4442e 1189 "MMMM d yy", " 04 05 06", "2006 04 05 00:00:00",
b75a7d8f 1190 NULL, "04 05 06", "2006 04 05 00:00:00",
46f4442e
A
1191
1192 "MM d yy", " 04 05 06", "2006 04 05 00:00:00",
1193 NULL, "04 05 06", "2006 04 05 00:00:00",
1194 NULL, "04/05/06", "2006 04 05 00:00:00",
1195 NULL, "04-05-06", "2006 04 05 00:00:00",
1196 NULL, "04.05.06", "2006 04 05 00:00:00",
1197 NULL, "04 / 05 / 06", "2006 04 05 00:00:00",
1198 NULL, "Apr / 05/ 06", "2006 04 05 00:00:00",
1199 NULL, "Apr-05-06", "2006 04 05 00:00:00",
1200 NULL, "Apr 05, 2006", "2006 04 05 00:00:00",
1201
b75a7d8f
A
1202 "MMMM d yy", " Apr 05 06", "2006 04 05 00:00:00",
1203 NULL, "Apr 05 06", "2006 04 05 00:00:00",
46f4442e
A
1204 NULL, "Apr05 06", "2006 04 05 00:00:00",
1205
1206 "hh:mm:ss a", "12:34:56 PM", "1970 01 01 12:34:56",
1207 NULL, "12:34:56PM", "1970 01 01 12:34:56",
1208 NULL, "12.34.56PM", "1970 01 01 12:34:56",
1209 NULL, "12-34-56 PM", "1970 01 01 12:34:56",
1210 NULL, "12 : 34 : 56 PM", "1970 01 01 12:34:56",
1211
1212 "MM d yy 'at' hh:mm:ss a", "04/05/06 12:34:56 PM", "2006 04 05 12:34:56",
1213
1214 "MMMM dd yyyy hh:mm a", "September 27, 1964 21:56 PM", "1964 09 28 09:56:00",
1215 NULL, "November 4, 2008 0:13 AM", "2008 11 04 00:13:00",
1216
1217 "HH'h'mm'min'ss's'", "12h34min56s", "1970 01 01 12:34:56",
1218 NULL, "12h34mi56s", "1970 01 01 12:34:56",
1219 NULL, "12h34m56s", "1970 01 01 12:34:56",
1220 NULL, "12:34:56", "1970 01 01 12:34:56"
b75a7d8f
A
1221 };
1222 const int32_t DATA_len = sizeof(DATA)/sizeof(DATA[0]);
1223
1224 expectParse(DATA, DATA_len, Locale("en"));
1225}
1226
1227/**
1228 * Test handling of "HHmmss" pattern.
1229 */
1230void DateFormatTest::TestExactCountFormat() {
1231 const char* DATA[] = {
1232 "yyyy MM dd HH:mm:ss",
1233
1234 // pattern, input, expected parse or NULL if expect parse failure
1235 "HHmmss", "123456", "1970 01 01 12:34:56",
1236 NULL, "12345", "1970 01 01 01:23:45",
1237 NULL, "1234", NULL,
1238 NULL, "00-05", NULL,
1239 NULL, "12-34", NULL,
1240 NULL, "00+05", NULL,
1241 "ahhmm", "PM730", "1970 01 01 19:30:00",
1242 };
1243 const int32_t DATA_len = sizeof(DATA)/sizeof(DATA[0]);
1244
1245 expectParse(DATA, DATA_len, Locale("en"));
1246}
1247
1248/**
1249 * Test handling of white space.
1250 */
1251void DateFormatTest::TestWhiteSpaceParsing() {
1252 const char* DATA[] = {
1253 "yyyy MM dd",
1254
1255 // pattern, input, expected parse or null if expect parse failure
1256
1257 // Pattern space run should parse input text space run
1258 "MM d yy", " 04 01 03", "2003 04 01",
1259 NULL, " 04 01 03 ", "2003 04 01",
1260 };
1261 const int32_t DATA_len = sizeof(DATA)/sizeof(DATA[0]);
1262
1263 expectParse(DATA, DATA_len, Locale("en"));
1264}
1265
374ca955
A
1266
1267void DateFormatTest::TestInvalidPattern() {
1268 UErrorCode ec = U_ZERO_ERROR;
1269 SimpleDateFormat f(UnicodeString("Yesterday"), ec);
73c04bcf 1270 ASSERT_OK(ec);
374ca955
A
1271 UnicodeString out;
1272 FieldPosition pos;
1273 f.format((UDate)0, out, pos);
1274 logln(out);
1275 // The bug is that the call to format() will crash. By not
1276 // crashing, the test passes.
1277}
1278
1279void DateFormatTest::TestGreekMay() {
1280 UErrorCode ec = U_ZERO_ERROR;
1281 UDate date = -9896080848000.0;
1282 SimpleDateFormat fmt("EEEE, dd MMMM yyyy h:mm:ss a", Locale("el", "", ""), ec);
1283 if (!assertSuccess("SimpleDateFormat::ct", ec)) return;
1284 UnicodeString str;
1285 fmt.format(date, str);
1286 ParsePosition pos(0);
1287 UDate d2 = fmt.parse(str, pos);
1288 if (date != d2) {
1289 errln("FAIL: unable to parse strings where case-folding changes length");
1290 }
1291}
1292
73c04bcf
A
1293void DateFormatTest::TestStandAloneMonths()
1294{
1295 const char *EN_DATA[] = {
1296 "yyyy MM dd HH:mm:ss",
1297
1298 "yyyy LLLL dd H:mm:ss", "fp", "2004 03 10 16:36:31", "2004 March 10 16:36:31", "2004 03 10 16:36:31",
1299 "yyyy LLL dd H:mm:ss", "fp", "2004 03 10 16:36:31", "2004 Mar 10 16:36:31", "2004 03 10 16:36:31",
1300 "yyyy LLLL dd H:mm:ss", "F", "2004 03 10 16:36:31", "2004 March 10 16:36:31",
1301 "yyyy LLL dd H:mm:ss", "pf", "2004 Mar 10 16:36:31", "2004 03 10 16:36:31", "2004 Mar 10 16:36:31",
1302
1303 "LLLL", "fp", "1970 01 01 0:00:00", "January", "1970 01 01 0:00:00",
1304 "LLLL", "fp", "1970 02 01 0:00:00", "February", "1970 02 01 0:00:00",
1305 "LLLL", "fp", "1970 03 01 0:00:00", "March", "1970 03 01 0:00:00",
1306 "LLLL", "fp", "1970 04 01 0:00:00", "April", "1970 04 01 0:00:00",
1307 "LLLL", "fp", "1970 05 01 0:00:00", "May", "1970 05 01 0:00:00",
1308 "LLLL", "fp", "1970 06 01 0:00:00", "June", "1970 06 01 0:00:00",
1309 "LLLL", "fp", "1970 07 01 0:00:00", "July", "1970 07 01 0:00:00",
1310 "LLLL", "fp", "1970 08 01 0:00:00", "August", "1970 08 01 0:00:00",
1311 "LLLL", "fp", "1970 09 01 0:00:00", "September", "1970 09 01 0:00:00",
1312 "LLLL", "fp", "1970 10 01 0:00:00", "October", "1970 10 01 0:00:00",
1313 "LLLL", "fp", "1970 11 01 0:00:00", "November", "1970 11 01 0:00:00",
1314 "LLLL", "fp", "1970 12 01 0:00:00", "December", "1970 12 01 0:00:00",
1315
1316 "LLL", "fp", "1970 01 01 0:00:00", "Jan", "1970 01 01 0:00:00",
1317 "LLL", "fp", "1970 02 01 0:00:00", "Feb", "1970 02 01 0:00:00",
1318 "LLL", "fp", "1970 03 01 0:00:00", "Mar", "1970 03 01 0:00:00",
1319 "LLL", "fp", "1970 04 01 0:00:00", "Apr", "1970 04 01 0:00:00",
1320 "LLL", "fp", "1970 05 01 0:00:00", "May", "1970 05 01 0:00:00",
1321 "LLL", "fp", "1970 06 01 0:00:00", "Jun", "1970 06 01 0:00:00",
1322 "LLL", "fp", "1970 07 01 0:00:00", "Jul", "1970 07 01 0:00:00",
1323 "LLL", "fp", "1970 08 01 0:00:00", "Aug", "1970 08 01 0:00:00",
1324 "LLL", "fp", "1970 09 01 0:00:00", "Sep", "1970 09 01 0:00:00",
1325 "LLL", "fp", "1970 10 01 0:00:00", "Oct", "1970 10 01 0:00:00",
1326 "LLL", "fp", "1970 11 01 0:00:00", "Nov", "1970 11 01 0:00:00",
1327 "LLL", "fp", "1970 12 01 0:00:00", "Dec", "1970 12 01 0:00:00",
1328 };
1329
1330 const char *CS_DATA[] = {
1331 "yyyy MM dd HH:mm:ss",
1332
1333 "yyyy LLLL dd H:mm:ss", "fp", "2004 04 10 16:36:31", "2004 duben 10 16:36:31", "2004 04 10 16:36:31",
1334 "yyyy MMMM dd H:mm:ss", "fp", "2004 04 10 16:36:31", "2004 dubna 10 16:36:31", "2004 04 10 16:36:31",
1335 "yyyy LLL dd H:mm:ss", "fp", "2004 04 10 16:36:31", "2004 4. 10 16:36:31", "2004 04 10 16:36:31",
1336 "yyyy LLLL dd H:mm:ss", "F", "2004 04 10 16:36:31", "2004 duben 10 16:36:31",
1337 "yyyy MMMM dd H:mm:ss", "F", "2004 04 10 16:36:31", "2004 dubna 10 16:36:31",
1338 "yyyy LLLL dd H:mm:ss", "pf", "2004 duben 10 16:36:31", "2004 04 10 16:36:31", "2004 duben 10 16:36:31",
1339 "yyyy MMMM dd H:mm:ss", "pf", "2004 dubna 10 16:36:31", "2004 04 10 16:36:31", "2004 dubna 10 16:36:31",
1340
1341 "LLLL", "fp", "1970 01 01 0:00:00", "leden", "1970 01 01 0:00:00",
1342 "LLLL", "fp", "1970 02 01 0:00:00", "\\u00FAnor", "1970 02 01 0:00:00",
1343 "LLLL", "fp", "1970 03 01 0:00:00", "b\\u0159ezen", "1970 03 01 0:00:00",
1344 "LLLL", "fp", "1970 04 01 0:00:00", "duben", "1970 04 01 0:00:00",
1345 "LLLL", "fp", "1970 05 01 0:00:00", "kv\\u011Bten", "1970 05 01 0:00:00",
1346 "LLLL", "fp", "1970 06 01 0:00:00", "\\u010Derven", "1970 06 01 0:00:00",
1347 "LLLL", "fp", "1970 07 01 0:00:00", "\\u010Dervenec", "1970 07 01 0:00:00",
1348 "LLLL", "fp", "1970 08 01 0:00:00", "srpen", "1970 08 01 0:00:00",
1349 "LLLL", "fp", "1970 09 01 0:00:00", "z\\u00E1\\u0159\\u00ED", "1970 09 01 0:00:00",
1350 "LLLL", "fp", "1970 10 01 0:00:00", "\\u0159\\u00EDjen", "1970 10 01 0:00:00",
1351 "LLLL", "fp", "1970 11 01 0:00:00", "listopad", "1970 11 01 0:00:00",
1352 "LLLL", "fp", "1970 12 01 0:00:00", "prosinec", "1970 12 01 0:00:00",
1353
1354 "LLL", "fp", "1970 01 01 0:00:00", "1.", "1970 01 01 0:00:00",
1355 "LLL", "fp", "1970 02 01 0:00:00", "2.", "1970 02 01 0:00:00",
1356 "LLL", "fp", "1970 03 01 0:00:00", "3.", "1970 03 01 0:00:00",
1357 "LLL", "fp", "1970 04 01 0:00:00", "4.", "1970 04 01 0:00:00",
1358 "LLL", "fp", "1970 05 01 0:00:00", "5.", "1970 05 01 0:00:00",
1359 "LLL", "fp", "1970 06 01 0:00:00", "6.", "1970 06 01 0:00:00",
1360 "LLL", "fp", "1970 07 01 0:00:00", "7.", "1970 07 01 0:00:00",
1361 "LLL", "fp", "1970 08 01 0:00:00", "8.", "1970 08 01 0:00:00",
1362 "LLL", "fp", "1970 09 01 0:00:00", "9.", "1970 09 01 0:00:00",
1363 "LLL", "fp", "1970 10 01 0:00:00", "10.", "1970 10 01 0:00:00",
1364 "LLL", "fp", "1970 11 01 0:00:00", "11.", "1970 11 01 0:00:00",
1365 "LLL", "fp", "1970 12 01 0:00:00", "12.", "1970 12 01 0:00:00",
1366 };
1367
1368 expect(EN_DATA, ARRAY_SIZE(EN_DATA), Locale("en", "", ""));
1369 expect(CS_DATA, ARRAY_SIZE(CS_DATA), Locale("cs", "", ""));
1370}
1371
1372void DateFormatTest::TestStandAloneDays()
1373{
1374 const char *EN_DATA[] = {
1375 "yyyy MM dd HH:mm:ss",
1376
1377 "cccc", "fp", "1970 01 04 0:00:00", "Sunday", "1970 01 04 0:00:00",
1378 "cccc", "fp", "1970 01 05 0:00:00", "Monday", "1970 01 05 0:00:00",
1379 "cccc", "fp", "1970 01 06 0:00:00", "Tuesday", "1970 01 06 0:00:00",
1380 "cccc", "fp", "1970 01 07 0:00:00", "Wednesday", "1970 01 07 0:00:00",
1381 "cccc", "fp", "1970 01 01 0:00:00", "Thursday", "1970 01 01 0:00:00",
1382 "cccc", "fp", "1970 01 02 0:00:00", "Friday", "1970 01 02 0:00:00",
1383 "cccc", "fp", "1970 01 03 0:00:00", "Saturday", "1970 01 03 0:00:00",
1384
1385 "ccc", "fp", "1970 01 04 0:00:00", "Sun", "1970 01 04 0:00:00",
1386 "ccc", "fp", "1970 01 05 0:00:00", "Mon", "1970 01 05 0:00:00",
1387 "ccc", "fp", "1970 01 06 0:00:00", "Tue", "1970 01 06 0:00:00",
1388 "ccc", "fp", "1970 01 07 0:00:00", "Wed", "1970 01 07 0:00:00",
1389 "ccc", "fp", "1970 01 01 0:00:00", "Thu", "1970 01 01 0:00:00",
1390 "ccc", "fp", "1970 01 02 0:00:00", "Fri", "1970 01 02 0:00:00",
1391 "ccc", "fp", "1970 01 03 0:00:00", "Sat", "1970 01 03 0:00:00",
1392 };
1393
1394 const char *CS_DATA[] = {
1395 "yyyy MM dd HH:mm:ss",
1396
1397 "cccc", "fp", "1970 01 04 0:00:00", "ned\\u011Ble", "1970 01 04 0:00:00",
1398 "cccc", "fp", "1970 01 05 0:00:00", "pond\\u011Bl\\u00ED", "1970 01 05 0:00:00",
1399 "cccc", "fp", "1970 01 06 0:00:00", "\\u00FAter\\u00FD", "1970 01 06 0:00:00",
1400 "cccc", "fp", "1970 01 07 0:00:00", "st\\u0159eda", "1970 01 07 0:00:00",
1401 "cccc", "fp", "1970 01 01 0:00:00", "\\u010Dtvrtek", "1970 01 01 0:00:00",
1402 "cccc", "fp", "1970 01 02 0:00:00", "p\\u00E1tek", "1970 01 02 0:00:00",
1403 "cccc", "fp", "1970 01 03 0:00:00", "sobota", "1970 01 03 0:00:00",
1404
1405 "ccc", "fp", "1970 01 04 0:00:00", "ne", "1970 01 04 0:00:00",
1406 "ccc", "fp", "1970 01 05 0:00:00", "po", "1970 01 05 0:00:00",
1407 "ccc", "fp", "1970 01 06 0:00:00", "\\u00FAt", "1970 01 06 0:00:00",
1408 "ccc", "fp", "1970 01 07 0:00:00", "st", "1970 01 07 0:00:00",
1409 "ccc", "fp", "1970 01 01 0:00:00", "\\u010Dt", "1970 01 01 0:00:00",
1410 "ccc", "fp", "1970 01 02 0:00:00", "p\\u00E1", "1970 01 02 0:00:00",
1411 "ccc", "fp", "1970 01 03 0:00:00", "so", "1970 01 03 0:00:00",
1412 };
1413
1414 expect(EN_DATA, ARRAY_SIZE(EN_DATA), Locale("en", "", ""));
1415 expect(CS_DATA, ARRAY_SIZE(CS_DATA), Locale("cs", "", ""));
1416}
1417
1418void DateFormatTest::TestNarrowNames()
1419{
1420 const char *EN_DATA[] = {
1421 "yyyy MM dd HH:mm:ss",
1422
1423 "yyyy MMMMM dd H:mm:ss", "2004 03 10 16:36:31", "2004 M 10 16:36:31",
1424 "yyyy LLLLL dd H:mm:ss", "2004 03 10 16:36:31", "2004 M 10 16:36:31",
1425
1426 "MMMMM", "1970 01 01 0:00:00", "J",
1427 "MMMMM", "1970 02 01 0:00:00", "F",
1428 "MMMMM", "1970 03 01 0:00:00", "M",
1429 "MMMMM", "1970 04 01 0:00:00", "A",
1430 "MMMMM", "1970 05 01 0:00:00", "M",
1431 "MMMMM", "1970 06 01 0:00:00", "J",
1432 "MMMMM", "1970 07 01 0:00:00", "J",
1433 "MMMMM", "1970 08 01 0:00:00", "A",
1434 "MMMMM", "1970 09 01 0:00:00", "S",
1435 "MMMMM", "1970 10 01 0:00:00", "O",
1436 "MMMMM", "1970 11 01 0:00:00", "N",
1437 "MMMMM", "1970 12 01 0:00:00", "D",
1438
1439 "LLLLL", "1970 01 01 0:00:00", "J",
1440 "LLLLL", "1970 02 01 0:00:00", "F",
1441 "LLLLL", "1970 03 01 0:00:00", "M",
1442 "LLLLL", "1970 04 01 0:00:00", "A",
1443 "LLLLL", "1970 05 01 0:00:00", "M",
1444 "LLLLL", "1970 06 01 0:00:00", "J",
1445 "LLLLL", "1970 07 01 0:00:00", "J",
1446 "LLLLL", "1970 08 01 0:00:00", "A",
1447 "LLLLL", "1970 09 01 0:00:00", "S",
1448 "LLLLL", "1970 10 01 0:00:00", "O",
1449 "LLLLL", "1970 11 01 0:00:00", "N",
1450 "LLLLL", "1970 12 01 0:00:00", "D",
1451
1452 "EEEEE", "1970 01 04 0:00:00", "S",
1453 "EEEEE", "1970 01 05 0:00:00", "M",
1454 "EEEEE", "1970 01 06 0:00:00", "T",
1455 "EEEEE", "1970 01 07 0:00:00", "W",
1456 "EEEEE", "1970 01 01 0:00:00", "T",
1457 "EEEEE", "1970 01 02 0:00:00", "F",
1458 "EEEEE", "1970 01 03 0:00:00", "S",
1459
1460 "ccccc", "1970 01 04 0:00:00", "S",
1461 "ccccc", "1970 01 05 0:00:00", "M",
1462 "ccccc", "1970 01 06 0:00:00", "T",
1463 "ccccc", "1970 01 07 0:00:00", "W",
1464 "ccccc", "1970 01 01 0:00:00", "T",
1465 "ccccc", "1970 01 02 0:00:00", "F",
1466 "ccccc", "1970 01 03 0:00:00", "S",
1467 };
1468
1469 const char *CS_DATA[] = {
1470 "yyyy MM dd HH:mm:ss",
1471
1472 "yyyy LLLLL dd H:mm:ss", "2004 04 10 16:36:31", "2004 d 10 16:36:31",
1473 "yyyy MMMMM dd H:mm:ss", "2004 04 10 16:36:31", "2004 d 10 16:36:31",
1474
1475 "MMMMM", "1970 01 01 0:00:00", "l",
1476 "MMMMM", "1970 02 01 0:00:00", "\\u00FA",
1477 "MMMMM", "1970 03 01 0:00:00", "b",
1478 "MMMMM", "1970 04 01 0:00:00", "d",
1479 "MMMMM", "1970 05 01 0:00:00", "k",
1480 "MMMMM", "1970 06 01 0:00:00", "\\u010D",
1481 "MMMMM", "1970 07 01 0:00:00", "\\u010D",
1482 "MMMMM", "1970 08 01 0:00:00", "s",
1483 "MMMMM", "1970 09 01 0:00:00", "z",
1484 "MMMMM", "1970 10 01 0:00:00", "\\u0159",
1485 "MMMMM", "1970 11 01 0:00:00", "l",
1486 "MMMMM", "1970 12 01 0:00:00", "p",
1487
1488 "LLLLL", "1970 01 01 0:00:00", "l",
1489 "LLLLL", "1970 02 01 0:00:00", "\\u00FA",
1490 "LLLLL", "1970 03 01 0:00:00", "b",
1491 "LLLLL", "1970 04 01 0:00:00", "d",
1492 "LLLLL", "1970 05 01 0:00:00", "k",
1493 "LLLLL", "1970 06 01 0:00:00", "\\u010D",
1494 "LLLLL", "1970 07 01 0:00:00", "\\u010D",
1495 "LLLLL", "1970 08 01 0:00:00", "s",
1496 "LLLLL", "1970 09 01 0:00:00", "z",
1497 "LLLLL", "1970 10 01 0:00:00", "\\u0159",
1498 "LLLLL", "1970 11 01 0:00:00", "l",
1499 "LLLLL", "1970 12 01 0:00:00", "p",
1500
1501 "EEEEE", "1970 01 04 0:00:00", "N",
1502 "EEEEE", "1970 01 05 0:00:00", "P",
1503 "EEEEE", "1970 01 06 0:00:00", "\\u00DA",
1504 "EEEEE", "1970 01 07 0:00:00", "S",
1505 "EEEEE", "1970 01 01 0:00:00", "\\u010C",
1506 "EEEEE", "1970 01 02 0:00:00", "P",
1507 "EEEEE", "1970 01 03 0:00:00", "S",
1508
1509 "ccccc", "1970 01 04 0:00:00", "N",
1510 "ccccc", "1970 01 05 0:00:00", "P",
1511 "ccccc", "1970 01 06 0:00:00", "\\u00DA",
1512 "ccccc", "1970 01 07 0:00:00", "S",
1513 "ccccc", "1970 01 01 0:00:00", "\\u010C",
1514 "ccccc", "1970 01 02 0:00:00", "P",
1515 "ccccc", "1970 01 03 0:00:00", "S",
1516 };
1517
1518 expectFormat(EN_DATA, ARRAY_SIZE(EN_DATA), Locale("en", "", ""));
1519 expectFormat(CS_DATA, ARRAY_SIZE(CS_DATA), Locale("cs", "", ""));
1520}
1521
1522void DateFormatTest::TestEras()
1523{
1524 const char *EN_DATA[] = {
1525 "yyyy MM dd",
1526
1527 "MMMM dd yyyy G", "fp", "1951 07 17", "July 17 1951 AD", "1951 07 17",
1528 "MMMM dd yyyy GG", "fp", "1951 07 17", "July 17 1951 AD", "1951 07 17",
1529 "MMMM dd yyyy GGG", "fp", "1951 07 17", "July 17 1951 AD", "1951 07 17",
1530 "MMMM dd yyyy GGGG", "fp", "1951 07 17", "July 17 1951 Anno Domini", "1951 07 17",
1531
1532 "MMMM dd yyyy G", "fp", "-438 07 17", "July 17 0439 BC", "-438 07 17",
1533 "MMMM dd yyyy GG", "fp", "-438 07 17", "July 17 0439 BC", "-438 07 17",
1534 "MMMM dd yyyy GGG", "fp", "-438 07 17", "July 17 0439 BC", "-438 07 17",
1535 "MMMM dd yyyy GGGG", "fp", "-438 07 17", "July 17 0439 Before Christ", "-438 07 17",
1536 };
1537
1538 expect(EN_DATA, ARRAY_SIZE(EN_DATA), Locale("en", "", ""));
1539}
1540
1541void DateFormatTest::TestQuarters()
1542{
1543 const char *EN_DATA[] = {
1544 "yyyy MM dd",
1545
1546 "Q", "fp", "1970 01 01", "1", "1970 01 01",
1547 "QQ", "fp", "1970 04 01", "02", "1970 04 01",
1548 "QQQ", "fp", "1970 07 01", "Q3", "1970 07 01",
1549 "QQQQ", "fp", "1970 10 01", "4th quarter", "1970 10 01",
1550
1551 "q", "fp", "1970 01 01", "1", "1970 01 01",
1552 "qq", "fp", "1970 04 01", "02", "1970 04 01",
1553 "qqq", "fp", "1970 07 01", "Q3", "1970 07 01",
1554 "qqqq", "fp", "1970 10 01", "4th quarter", "1970 10 01",
1555 };
1556
1557 expect(EN_DATA, ARRAY_SIZE(EN_DATA), Locale("en", "", ""));
1558}
1559
b75a7d8f
A
1560/**
1561 * Test parsing. Input is an array that starts with the following
1562 * header:
1563 *
1564 * [0] = pattern string to parse [i+2] with
1565 *
1566 * followed by test cases, each of which is 3 array elements:
1567 *
1568 * [i] = pattern, or NULL to reuse prior pattern
1569 * [i+1] = input string
1570 * [i+2] = expected parse result (parsed with pattern [0])
1571 *
1572 * If expect parse failure, then [i+2] should be NULL.
1573 */
1574void DateFormatTest::expectParse(const char** data, int32_t data_length,
1575 const Locale& loc) {
1576 const UDate FAIL = (UDate) -1;
1577 const UnicodeString FAIL_STR("parse failure");
1578 int32_t i = 0;
1579
1580 UErrorCode ec = U_ZERO_ERROR;
1581 SimpleDateFormat fmt("", loc, ec);
1582 SimpleDateFormat ref(data[i++], loc, ec);
1583 SimpleDateFormat gotfmt("G yyyy MM dd HH:mm:ss z", loc, ec);
1584 if (U_FAILURE(ec)) {
1585 errln("FAIL: SimpleDateFormat constructor");
1586 return;
1587 }
1588
1589 const char* currentPat = NULL;
1590 while (i<data_length) {
1591 const char* pattern = data[i++];
1592 const char* input = data[i++];
1593 const char* expected = data[i++];
1594
1595 ec = U_ZERO_ERROR;
1596 if (pattern != NULL) {
1597 fmt.applyPattern(pattern);
1598 currentPat = pattern;
1599 }
1600 UDate got = fmt.parse(input, ec);
1601 UnicodeString gotstr(FAIL_STR);
1602 if (U_FAILURE(ec)) {
1603 got = FAIL;
1604 } else {
1605 gotstr.remove();
1606 gotfmt.format(got, gotstr);
1607 }
1608
1609 UErrorCode ec2 = U_ZERO_ERROR;
1610 UDate exp = FAIL;
1611 UnicodeString expstr(FAIL_STR);
1612 if (expected != NULL) {
1613 expstr = expected;
1614 exp = ref.parse(expstr, ec2);
1615 if (U_FAILURE(ec2)) {
1616 // This only happens if expected is in wrong format --
1617 // should never happen once test is debugged.
1618 errln("FAIL: Internal test error");
1619 return;
1620 }
1621 }
1622
1623 if (got == exp) {
1624 logln((UnicodeString)"Ok: " + input + " x " +
1625 currentPat + " => " + gotstr);
1626 } else {
1627 errln((UnicodeString)"FAIL: " + input + " x " +
1628 currentPat + " => " + gotstr + ", expected " +
1629 expstr);
1630 }
1631 }
1632}
1633
374ca955
A
1634/**
1635 * Test formatting and parsing. Input is an array that starts
1636 * with the following header:
1637 *
1638 * [0] = pattern string to parse [i+2] with
1639 *
1640 * followed by test cases, each of which is 3 array elements:
1641 *
1642 * [i] = pattern, or null to reuse prior pattern
1643 * [i+1] = control string, either "fp", "pf", or "F".
1644 * [i+2..] = data strings
1645 *
1646 * The number of data strings depends on the control string.
1647 * Examples:
1648 * 1. "y/M/d H:mm:ss.SS", "fp", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.56", "2004 03 10 16:36:31.560",
1649 * 'f': Format date [i+2] (as parsed using pattern [0]) and expect string [i+3].
1650 * 'p': Parse string [i+3] and expect date [i+4].
1651 *
1652 * 2. "y/M/d H:mm:ss.SSS", "F", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.567"
1653 * 'F': Format date [i+2] and expect string [i+3],
1654 * then parse string [i+3] and expect date [i+2].
1655 *
1656 * 3. "y/M/d H:mm:ss.SSSS", "pf", "2004/3/10 16:36:31.5679", "2004 03 10 16:36:31.567", "2004/3/10 16:36:31.5670",
1657 * 'p': Parse string [i+2] and expect date [i+3].
1658 * 'f': Format date [i+3] and expect string [i+4].
1659 */
1660void DateFormatTest::expect(const char** data, int32_t data_length,
1661 const Locale& loc) {
1662 int32_t i = 0;
1663 UErrorCode ec = U_ZERO_ERROR;
1664 UnicodeString str, str2;
1665 SimpleDateFormat fmt("", loc, ec);
1666 SimpleDateFormat ref(data[i++], loc, ec);
1667 SimpleDateFormat univ("EE G yyyy MM dd HH:mm:ss.SSS z", loc, ec);
1668 if (!assertSuccess("construct SimpleDateFormat", ec)) return;
1669
1670 UnicodeString currentPat;
1671 while (i<data_length) {
1672 const char* pattern = data[i++];
1673 if (pattern != NULL) {
1674 fmt.applyPattern(pattern);
1675 currentPat = pattern;
1676 }
1677
1678 const char* control = data[i++];
1679
1680 if (uprv_strcmp(control, "fp") == 0) {
1681 // 'f'
1682 const char* datestr = data[i++];
1683 const char* string = data[i++];
73c04bcf 1684 UDate date = ref.parse(ctou(datestr), ec);
374ca955
A
1685 if (!assertSuccess("parse", ec)) return;
1686 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
73c04bcf 1687 ctou(string),
374ca955
A
1688 fmt.format(date, str.remove()));
1689 // 'p'
1690 datestr = data[i++];
73c04bcf 1691 date = ref.parse(ctou(datestr), ec);
374ca955 1692 if (!assertSuccess("parse", ec)) return;
73c04bcf 1693 UDate parsedate = fmt.parse(ctou(string), ec);
374ca955
A
1694 if (assertSuccess((UnicodeString)"\"" + currentPat + "\".parse(" + string + ")", ec)) {
1695 assertEquals((UnicodeString)"\"" + currentPat + "\".parse(" + string + ")",
1696 univ.format(date, str.remove()),
1697 univ.format(parsedate, str2.remove()));
1698 }
1699 }
1700
1701 else if (uprv_strcmp(control, "pf") == 0) {
1702 // 'p'
1703 const char* string = data[i++];
1704 const char* datestr = data[i++];
73c04bcf 1705 UDate date = ref.parse(ctou(datestr), ec);
374ca955 1706 if (!assertSuccess("parse", ec)) return;
73c04bcf 1707 UDate parsedate = fmt.parse(ctou(string), ec);
374ca955
A
1708 if (assertSuccess((UnicodeString)"\"" + currentPat + "\".parse(" + string + ")", ec)) {
1709 assertEquals((UnicodeString)"\"" + currentPat + "\".parse(" + string + ")",
1710 univ.format(date, str.remove()),
1711 univ.format(parsedate, str2.remove()));
1712 }
1713 // 'f'
1714 string = data[i++];
1715 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
73c04bcf 1716 ctou(string),
374ca955
A
1717 fmt.format(date, str.remove()));
1718 }
1719
1720 else if (uprv_strcmp(control, "F") == 0) {
1721 const char* datestr = data[i++];
1722 const char* string = data[i++];
73c04bcf 1723 UDate date = ref.parse(ctou(datestr), ec);
374ca955
A
1724 if (!assertSuccess("parse", ec)) return;
1725 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
73c04bcf 1726 ctou(string),
374ca955
A
1727 fmt.format(date, str.remove()));
1728
1729 UDate parsedate = fmt.parse(string, ec);
1730 if (assertSuccess((UnicodeString)"\"" + currentPat + "\".parse(" + string + ")", ec)) {
1731 assertEquals((UnicodeString)"\"" + currentPat + "\".parse(" + string + ")",
1732 univ.format(date, str.remove()),
1733 univ.format(parsedate, str2.remove()));
1734 }
1735 }
1736
1737 else {
1738 errln((UnicodeString)"FAIL: Invalid control string " + control);
1739 return;
1740 }
1741 }
1742}
1743
73c04bcf
A
1744/**
1745 * Test formatting. Input is an array that starts
1746 * with the following header:
1747 *
1748 * [0] = pattern string to parse [i+2] with
1749 *
1750 * followed by test cases, each of which is 3 array elements:
1751 *
1752 * [i] = pattern, or null to reuse prior pattern
1753 * [i+1] = data string a
1754 * [i+2] = data string b
1755 *
1756 * Examples:
1757 * Format date [i+1] and expect string [i+2].
1758 *
1759 * "y/M/d H:mm:ss.SSSS", "2004/3/10 16:36:31.5679", "2004 03 10 16:36:31.567"
1760 */
1761void DateFormatTest::expectFormat(const char** data, int32_t data_length,
1762 const Locale& loc) {
1763 int32_t i = 0;
1764 UErrorCode ec = U_ZERO_ERROR;
1765 UnicodeString str, str2;
1766 SimpleDateFormat fmt("", loc, ec);
1767 SimpleDateFormat ref(data[i++], loc, ec);
1768 SimpleDateFormat univ("EE G yyyy MM dd HH:mm:ss.SSS z", loc, ec);
1769 if (!assertSuccess("construct SimpleDateFormat", ec)) return;
1770
1771 UnicodeString currentPat;
1772
1773 while (i<data_length) {
1774 const char* pattern = data[i++];
1775 if (pattern != NULL) {
1776 fmt.applyPattern(pattern);
1777 currentPat = pattern;
1778 }
1779
1780 const char* datestr = data[i++];
1781 const char* string = data[i++];
1782 UDate date = ref.parse(ctou(datestr), ec);
1783 if (!assertSuccess("parse", ec)) return;
1784 assertEquals((UnicodeString)"\"" + currentPat + "\".format(" + datestr + ")",
1785 ctou(string),
1786 fmt.format(date, str.remove()));
1787 }
1788}
1789
1790void DateFormatTest::TestGenericTime() {
1791 // any zone pattern should parse any zone
1792 const Locale en("en");
1793 const char* ZDATA[] = {
1794 "yyyy MM dd HH:mm zzz",
1795 // round trip
1796 "y/M/d H:mm zzzz", "F", "2004 01 01 01:00 PST", "2004/1/1 1:00 Pacific Standard Time",
1797 "y/M/d H:mm zzz", "F", "2004 01 01 01:00 PST", "2004/1/1 1:00 PST",
1798 "y/M/d H:mm vvvv", "F", "2004 01 01 01:00 PST", "2004/1/1 1:00 Pacific Time",
46f4442e 1799 "y/M/d H:mm v", "F", "2004 01 01 01:00 PST", "2004/1/1 1:00 PT",
73c04bcf
A
1800 // non-generic timezone string influences dst offset even if wrong for date/time
1801 "y/M/d H:mm zzz", "pf", "2004/1/1 1:00 PDT", "2004 01 01 01:00 PDT", "2004/1/1 0:00 PST",
1802 "y/M/d H:mm vvvv", "pf", "2004/1/1 1:00 PDT", "2004 01 01 01:00 PDT", "2004/1/1 0:00 Pacific Time",
1803 "y/M/d H:mm zzz", "pf", "2004/7/1 1:00 PST", "2004 07 01 02:00 PDT", "2004/7/1 2:00 PDT",
1804 "y/M/d H:mm vvvv", "pf", "2004/7/1 1:00 PST", "2004 07 01 02:00 PDT", "2004/7/1 2:00 Pacific Time",
1805 // generic timezone generates dst offset appropriate for local time
1806 "y/M/d H:mm zzz", "pf", "2004/1/1 1:00 PT", "2004 01 01 01:00 PST", "2004/1/1 1:00 PST",
1807 "y/M/d H:mm vvvv", "pf", "2004/1/1 1:00 PT", "2004 01 01 01:00 PST", "2004/1/1 1:00 Pacific Time",
1808 "y/M/d H:mm zzz", "pf", "2004/7/1 1:00 PT", "2004 07 01 01:00 PDT", "2004/7/1 1:00 PDT",
1809 "y/M/d H:mm vvvv", "pf", "2004/7/1 1:00 PT", "2004 07 01 01:00 PDT", "2004/7/1 1:00 Pacific Time",
1810 // daylight savings time transition edge cases.
1811 // time to parse does not really exist, PT interpreted as earlier time
46f4442e 1812 "y/M/d H:mm zzz", "pf", "2005/4/3 2:30 PT", "2005 04 03 03:30 PDT", "2005/4/3 3:30 PDT",
73c04bcf
A
1813 "y/M/d H:mm zzz", "pf", "2005/4/3 2:30 PST", "2005 04 03 03:30 PDT", "2005/4/3 3:30 PDT",
1814 "y/M/d H:mm zzz", "pf", "2005/4/3 2:30 PDT", "2005 04 03 01:30 PST", "2005/4/3 1:30 PST",
46f4442e
A
1815 "y/M/d H:mm v", "pf", "2005/4/3 2:30 PT", "2005 04 03 03:30 PDT", "2005/4/3 3:30 PT",
1816 "y/M/d H:mm v", "pf", "2005/4/3 2:30 PST", "2005 04 03 03:30 PDT", "2005/4/3 3:30 PT",
1817 "y/M/d H:mm v", "pf", "2005/4/3 2:30 PDT", "2005 04 03 01:30 PST", "2005/4/3 1:30 PT",
1818 "y/M/d H:mm", "pf", "2005/4/3 2:30", "2005 04 03 03:30 PDT", "2005/4/3 3:30",
1819 // time to parse is ambiguous, PT interpreted as later time
1820 "y/M/d H:mm zzz", "pf", "2005/10/30 1:30 PT", "2005 10 30 01:30 PST", "2005/10/30 1:30 PST",
1821 "y/M/d H:mm v", "pf", "2005/10/30 1:30 PT", "2005 10 30 01:30 PST", "2005/10/30 1:30 PT",
1822 "y/M/d H:mm", "pf", "2005/10/30 1:30 PT", "2005 10 30 01:30 PST", "2005/10/30 1:30",
1823
1824 "y/M/d H:mm zzz", "pf", "2004/10/31 1:30 PT", "2004 10 31 01:30 PST", "2004/10/31 1:30 PST",
73c04bcf
A
1825 "y/M/d H:mm zzz", "pf", "2004/10/31 1:30 PST", "2004 10 31 01:30 PST", "2004/10/31 1:30 PST",
1826 "y/M/d H:mm zzz", "pf", "2004/10/31 1:30 PDT", "2004 10 31 01:30 PDT", "2004/10/31 1:30 PDT",
46f4442e
A
1827 "y/M/d H:mm v", "pf", "2004/10/31 1:30 PT", "2004 10 31 01:30 PST", "2004/10/31 1:30 PT",
1828 "y/M/d H:mm v", "pf", "2004/10/31 1:30 PST", "2004 10 31 01:30 PST", "2004/10/31 1:30 PT",
1829 "y/M/d H:mm v", "pf", "2004/10/31 1:30 PDT", "2004 10 31 01:30 PDT", "2004/10/31 1:30 PT",
1830 "y/M/d H:mm", "pf", "2004/10/31 1:30", "2004 10 31 01:30 PST", "2004/10/31 1:30",
73c04bcf
A
1831 };
1832 const int32_t ZDATA_length = sizeof(ZDATA)/ sizeof(ZDATA[0]);
1833 expect(ZDATA, ZDATA_length, en);
1834
1835 UErrorCode status = U_ZERO_ERROR;
1836
1837 logln("cross format/parse tests");
1838 UnicodeString basepat("yy/MM/dd H:mm ");
1839 SimpleDateFormat formats[] = {
1840 SimpleDateFormat(basepat + "vvv", en, status),
1841 SimpleDateFormat(basepat + "vvvv", en, status),
1842 SimpleDateFormat(basepat + "zzz", en, status),
1843 SimpleDateFormat(basepat + "zzzz", en, status)
1844 };
1845 ASSERT_OK(status);
1846 const int32_t formats_length = sizeof(formats)/sizeof(formats[0]);
1847
1848 UnicodeString test;
1849 SimpleDateFormat univ("yyyy MM dd HH:mm zzz", en, status);
1850 ASSERT_OK(status);
1851 const UnicodeString times[] = {
1852 "2004 01 02 03:04 PST",
1853 "2004 07 08 09:10 PDT"
1854 };
1855 int32_t times_length = sizeof(times)/sizeof(times[0]);
1856 for (int i = 0; i < times_length; ++i) {
1857 UDate d = univ.parse(times[i], status);
1858 logln(UnicodeString("\ntime: ") + d);
1859 for (int j = 0; j < formats_length; ++j) {
1860 test.remove();
1861 formats[j].format(d, test);
1862 logln("\ntest: '" + test + "'");
1863 for (int k = 0; k < formats_length; ++k) {
1864 UDate t = formats[k].parse(test, status);
1865 if (U_SUCCESS(status)) {
1866 if (d != t) {
1867 errln((UnicodeString)"FAIL: format " + k +
1868 " incorrectly parsed output of format " + j +
1869 " (" + test + "), returned " +
1870 dateToString(t) + " instead of " + dateToString(d));
1871 } else {
1872 logln((UnicodeString)"OK: format " + k + " parsed ok");
1873 }
1874 } else if (status == U_PARSE_ERROR) {
1875 errln((UnicodeString)"FAIL: format " + k +
1876 " could not parse output of format " + j +
1877 " (" + test + ")");
1878 }
1879 }
1880 }
1881 }
1882}
1883
1884void DateFormatTest::TestGenericTimeZoneOrder() {
1885 // generic times should parse the same no matter what the placement of the time zone string
1886 // should work for standard and daylight times
1887
1888 const char* XDATA[] = {
1889 "yyyy MM dd HH:mm zzz",
1890 // standard time, explicit daylight/standard
1891 "y/M/d H:mm zzz", "pf", "2004/1/1 1:00 PT", "2004 01 01 01:00 PST", "2004/1/1 1:00 PST",
1892 "y/M/d zzz H:mm", "pf", "2004/1/1 PT 1:00", "2004 01 01 01:00 PST", "2004/1/1 PST 1:00",
1893 "zzz y/M/d H:mm", "pf", "PT 2004/1/1 1:00", "2004 01 01 01:00 PST", "PST 2004/1/1 1:00",
1894
1895 // standard time, generic
1896 "y/M/d H:mm vvvv", "pf", "2004/1/1 1:00 PT", "2004 01 01 01:00 PST", "2004/1/1 1:00 Pacific Time",
1897 "y/M/d vvvv H:mm", "pf", "2004/1/1 PT 1:00", "2004 01 01 01:00 PST", "2004/1/1 Pacific Time 1:00",
1898 "vvvv y/M/d H:mm", "pf", "PT 2004/1/1 1:00", "2004 01 01 01:00 PST", "Pacific Time 2004/1/1 1:00",
1899
1900 // dahylight time, explicit daylight/standard
1901 "y/M/d H:mm zzz", "pf", "2004/7/1 1:00 PT", "2004 07 01 01:00 PDT", "2004/7/1 1:00 PDT",
1902 "y/M/d zzz H:mm", "pf", "2004/7/1 PT 1:00", "2004 07 01 01:00 PDT", "2004/7/1 PDT 1:00",
1903 "zzz y/M/d H:mm", "pf", "PT 2004/7/1 1:00", "2004 07 01 01:00 PDT", "PDT 2004/7/1 1:00",
1904
1905 // daylight time, generic
1906 "y/M/d H:mm vvvv", "pf", "2004/7/1 1:00 PT", "2004 07 01 01:00 PDT", "2004/7/1 1:00 Pacific Time",
1907 "y/M/d vvvv H:mm", "pf", "2004/7/1 PT 1:00", "2004 07 01 01:00 PDT", "2004/7/1 Pacific Time 1:00",
1908 "vvvv y/M/d H:mm", "pf", "PT 2004/7/1 1:00", "2004 07 01 01:00 PDT", "Pacific Time 2004/7/1 1:00",
1909 };
1910 const int32_t XDATA_length = sizeof(XDATA)/sizeof(XDATA[0]);
1911 Locale en("en");
1912 expect(XDATA, XDATA_length, en);
1913}
1914
46f4442e
A
1915void DateFormatTest::TestZTimeZoneParsing(void) {
1916 UErrorCode status = U_ZERO_ERROR;
1917 const Locale en("en");
1918 UnicodeString test;
1919 //SimpleDateFormat univ("yyyy-MM-dd'T'HH:mm Z", en, status);
1920 SimpleDateFormat univ("HH:mm Z", en, status);
1921 const TimeZone *t = TimeZone::getGMT();
1922 univ.setTimeZone(*t);
1923
1924 univ.setLenient(false);
1925 ParsePosition pp(0);
1926 ASSERT_OK(status);
1927 struct {
1928 UnicodeString input;
1929 UnicodeString expected_result;
1930 } tests[] = {
1931 { "11:00 -0200", "13:00 +0000" },
1932 { "11:00 +0200", "09:00 +0000" },
1933 { "11:00 +0400", "07:00 +0000" },
1934 { "11:00 +0530", "05:30 +0000" }
1935 };
1936
1937 UnicodeString result;
1938 int32_t tests_length = sizeof(tests)/sizeof(tests[0]);
1939 for (int i = 0; i < tests_length; ++i) {
1940 pp.setIndex(0);
1941 UDate d = univ.parse(tests[i].input, pp);
1942 if(pp.getIndex() != tests[i].input.length()){
1943 errln("Test %i: setZoneString() did not succeed. Consumed: %i instead of %i",
1944 i, pp.getIndex(), tests[i].input.length());
1945 return;
1946 }
1947 result.remove();
1948 univ.format(d, result);
1949 if(result != tests[i].expected_result) {
1950 errln("Expected " + tests[i].expected_result
1951 + " got " + result);
1952 return;
1953 }
1954 logln("SUCCESS: Parsed " + tests[i].input
1955 + " got " + result
1956 + " expected " + tests[i].expected_result);
1957 }
1958}
1959
1960void DateFormatTest::TestHost(void)
1961{
1962#ifdef U_WINDOWS
1963 Win32DateTimeTest::testLocales(this);
1964#endif
1965}
1966
1967// Relative Date Tests
1968
1969void DateFormatTest::TestRelative(int daysdelta,
1970 const Locale& loc,
1971 const char *expectChars) {
1972 char banner[25];
1973 sprintf(banner, "%d", daysdelta);
1974 UnicodeString bannerStr(banner, "");
1975
1976 UErrorCode status = U_ZERO_ERROR;
1977
1978 FieldPosition pos(0);
1979 UnicodeString test;
1980 Locale en("en");
1981 DateFormat *fullrelative = DateFormat::createDateInstance(DateFormat::kFullRelative, loc);
1982
1983 if (fullrelative == NULL) {
1984 errln("DateFormat::createDateInstance(DateFormat::kFullRelative, %s) returned NULL", loc.getName());
1985 return;
1986 }
1987
1988 DateFormat *full = DateFormat::createDateInstance(DateFormat::kFull , loc);
1989
1990 if (full == NULL) {
1991 errln("DateFormat::createDateInstance(DateFormat::kFull, %s) returned NULL", loc.getName());
1992 return;
1993 }
1994
1995 DateFormat *en_full = DateFormat::createDateInstance(DateFormat::kFull, en);
1996
1997 if (en_full == NULL) {
1998 errln("DateFormat::createDateInstance(DateFormat::kFull, en) returned NULL");
1999 return;
2000 }
2001
2002 DateFormat *en_fulltime = DateFormat::createDateTimeInstance(DateFormat::kFull,DateFormat::kFull,en);
2003
2004 if (en_fulltime == NULL) {
2005 errln("DateFormat::createDateTimeInstance(DateFormat::kFull, DateFormat::kFull, en) returned NULL");
73c04bcf
A
2006 return;
2007 }
46f4442e
A
2008
2009 UnicodeString result;
2010 UnicodeString normalResult;
2011 UnicodeString expect;
2012 UnicodeString parseResult;
2013
2014 Calendar *c = Calendar::createInstance(status);
2015
2016 // Today = Today
2017 c->setTime(Calendar::getNow(), status);
2018 if(daysdelta != 0) {
2019 c->add(Calendar::DATE,daysdelta,status);
2020 }
2021 ASSERT_OK(status);
2022
2023 // calculate the expected string
2024 if(expectChars != NULL) {
2025 expect = expectChars;
2026 } else {
2027 full->format(*c, expect, pos); // expected = normal full
2028 }
2029
2030 fullrelative ->format(*c, result, pos);
2031 en_full ->format(*c, normalResult, pos);
2032
2033 if(result != expect) {
2034 errln("FAIL: Relative Format ["+bannerStr+"] of "+normalResult+" failed, expected "+expect+" but got " + result);
2035 } else {
2036 logln("PASS: Relative Format ["+bannerStr+"] of "+normalResult+" got " + result);
2037 }
2038
73c04bcf 2039
46f4442e
A
2040 //verify
2041 UDate d = fullrelative->parse(result, status);
73c04bcf 2042 ASSERT_OK(status);
46f4442e
A
2043
2044 UnicodeString parseFormat; // parse rel->format full
2045 en_full->format(d, parseFormat, status);
2046
2047 UnicodeString origFormat;
2048 en_full->format(*c, origFormat, pos);
2049
2050 if(parseFormat!=origFormat) {
2051 errln("FAIL: Relative Parse ["+bannerStr+"] of "+result+" failed, expected "+parseFormat+" but got "+origFormat);
2052 } else {
2053 logln("PASS: Relative Parse ["+bannerStr+"] of "+result+" passed, got "+parseFormat);
2054 }
2055
2056 delete full;
2057 delete fullrelative;
2058 delete en_fulltime;
2059 delete en_full;
2060 delete c;
2061}
2062
2063
2064void DateFormatTest::TestRelative(void)
2065{
2066 Locale en("en");
2067 TestRelative( 0, en, "Today");
2068 TestRelative(-1, en, "Yesterday");
2069 TestRelative( 1, en, "Tomorrow");
2070 TestRelative( 2, en, NULL);
2071 TestRelative( -2, en, NULL);
2072 TestRelative( 3, en, NULL);
2073 TestRelative( -3, en, NULL);
2074 TestRelative( 300, en, NULL);
2075 TestRelative( -300, en, NULL);
2076}
2077
2078void DateFormatTest::TestRelativeClone(void)
2079{
2080 /*
2081 Verify that a cloned formatter gives the same results
2082 and is useable after the original has been deleted.
2083 */
2084 UErrorCode status = U_ZERO_ERROR;
2085 Locale loc("en");
2086 UDate now = Calendar::getNow();
2087 DateFormat *full = DateFormat::createDateInstance(DateFormat::kFullRelative, loc);
2088 if (full == NULL) {
2089 errln("FAIL: Can't create Relative date instance");
2090 return;
73c04bcf 2091 }
46f4442e
A
2092 UnicodeString result1;
2093 full->format(now, result1, status);
2094 Format *fullClone = full->clone();
2095 delete full;
2096 full = NULL;
73c04bcf 2097
46f4442e
A
2098 UnicodeString result2;
2099 fullClone->format(now, result2, status);
2100 ASSERT_OK(status);
2101 if (result1 != result2) {
2102 errln("FAIL: Clone returned different result from non-clone.");
73c04bcf 2103 }
46f4442e
A
2104 delete fullClone;
2105}
2106
2107void DateFormatTest::TestHostClone(void)
2108{
2109 /*
2110 Verify that a cloned formatter gives the same results
2111 and is useable after the original has been deleted.
2112 */
2113 // This is mainly important on Windows.
2114 UErrorCode status = U_ZERO_ERROR;
2115 Locale loc("en_US@compat=host");
2116 UDate now = Calendar::getNow();
2117 DateFormat *full = DateFormat::createDateInstance(DateFormat::kFull, loc);
2118 if (full == NULL) {
2119 errln("FAIL: Can't create Relative date instance");
73c04bcf
A
2120 return;
2121 }
46f4442e
A
2122 UnicodeString result1;
2123 full->format(now, result1, status);
2124 Format *fullClone = full->clone();
2125 delete full;
2126 full = NULL;
2127
2128 UnicodeString result2;
2129 fullClone->format(now, result2, status);
2130 ASSERT_OK(status);
2131 if (result1 != result2) {
2132 errln("FAIL: Clone returned different result from non-clone.");
2133 }
2134 delete fullClone;
2135}
2136
2137void DateFormatTest::TestTimeZoneDisplayName()
2138{
2139 // This test data was ported from ICU4J. Don't know why the 6th column in there because it's not being
2140 // used currently.
2141 const char *fallbackTests[][6] = {
2142 { "en", "America/Los_Angeles", "2004-01-15T00:00:00Z", "Z", "-0800", "-8:00" },
2143 { "en", "America/Los_Angeles", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-08:00", "-8:00" },
2144 { "en", "America/Los_Angeles", "2004-01-15T00:00:00Z", "z", "PST", "America/Los_Angeles" },
2145 { "en", "America/Los_Angeles", "2004-01-15T00:00:00Z", "V", "PST", "America/Los_Angeles" },
2146 { "en", "America/Los_Angeles", "2004-01-15T00:00:00Z", "zzzz", "Pacific Standard Time", "America/Los_Angeles" },
2147 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "Z", "-0700", "-7:00" },
2148 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-07:00", "-7:00" },
2149 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "z", "PDT", "America/Los_Angeles" },
2150 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "V", "PDT", "America/Los_Angeles" },
2151 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "zzzz", "Pacific Daylight Time", "America/Los_Angeles" },
2152 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "v", "PT", "America/Los_Angeles" },
2153 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "vvvv", "Pacific Time", "America/Los_Angeles" },
2154 { "en", "America/Los_Angeles", "2004-07-15T00:00:00Z", "VVVV", "United States (Los Angeles)", "America/Los_Angeles" },
2155 { "en_GB", "America/Los_Angeles", "2004-01-15T12:00:00Z", "z", "PST", "America/Los_Angeles" },
2156 { "en", "America/Phoenix", "2004-01-15T00:00:00Z", "Z", "-0700", "-7:00" },
2157 { "en", "America/Phoenix", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-07:00", "-7:00" },
2158 { "en", "America/Phoenix", "2004-01-15T00:00:00Z", "z", "MST", "America/Phoenix" },
2159 { "en", "America/Phoenix", "2004-01-15T00:00:00Z", "V", "MST", "America/Phoenix" },
2160 { "en", "America/Phoenix", "2004-01-15T00:00:00Z", "zzzz", "Mountain Standard Time", "America/Phoenix" },
2161 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "Z", "-0700", "-7:00" },
2162 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-07:00", "-7:00" },
2163 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "z", "MST", "America/Phoenix" },
2164 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "V", "MST", "America/Phoenix" },
2165 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "zzzz", "Mountain Standard Time", "America/Phoenix" },
2166 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "v", "MST", "America/Phoenix" },
2167 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "vvvv", "Mountain Standard Time", "America/Phoenix" },
2168 { "en", "America/Phoenix", "2004-07-15T00:00:00Z", "VVVV", "United States (Phoenix)", "America/Phoenix" },
2169
2170 { "en", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2171 { "en", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2172 { "en", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2173 { "en", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "V", "ART", "-3:00" },
2174 { "en", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "Argentina Time", "-3:00" },
2175 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2176 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2177 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2178 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "V", "ART", "-3:00" },
2179 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "Argentina Time", "-3:00" },
2180 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "Argentina (Buenos Aires)", "America/Buenos_Aires" },
2181 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "Argentina Time", "America/Buenos_Aires" },
2182 { "en", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "VVVV", "Argentina (Buenos Aires)", "America/Buenos_Aires" },
2183
2184 { "en", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2185 { "en", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2186 { "en", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2187 { "en", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "V", "ART", "-3:00" },
2188 { "en", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "Argentina Time", "-3:00" },
2189 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2190 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2191 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2192 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "V", "ART", "-3:00" },
2193 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "Argentina Time", "-3:00" },
2194 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "Argentina (Buenos Aires)", "America/Buenos_Aires" },
2195 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "Argentina Time", "America/Buenos_Aires" },
2196 { "en", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "VVVV", "Argentina (Buenos Aires)", "America/Buenos_Aires" },
2197
2198 { "en", "America/Havana", "2004-01-15T00:00:00Z", "Z", "-0500", "-5:00" },
2199 { "en", "America/Havana", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-05:00", "-5:00" },
2200 { "en", "America/Havana", "2004-01-15T00:00:00Z", "z", "GMT-05:00", "-5:00" },
2201 { "en", "America/Havana", "2004-01-15T00:00:00Z", "V", "CST (Cuba)", "-5:00" },
2202 { "en", "America/Havana", "2004-01-15T00:00:00Z", "zzzz", "Cuba Standard Time", "-5:00" },
2203 { "en", "America/Havana", "2004-07-15T00:00:00Z", "Z", "-0400", "-4:00" },
2204 { "en", "America/Havana", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-04:00", "-4:00" },
2205 { "en", "America/Havana", "2004-07-15T00:00:00Z", "z", "GMT-04:00", "-4:00" },
2206 { "en", "America/Havana", "2004-07-15T00:00:00Z", "V", "CDT (Cuba)", "-4:00" },
2207 { "en", "America/Havana", "2004-07-15T00:00:00Z", "zzzz", "Cuba Daylight Time", "-4:00" },
2208 { "en", "America/Havana", "2004-07-15T00:00:00Z", "v", "Cuba Time", "America/Havana" },
2209 { "en", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "Cuba Time", "America/Havana" },
2210 { "en", "America/Havana", "2004-07-15T00:00:00Z", "VVVV", "Cuba Time", "America/Havana" },
2211
2212 { "en", "Australia/ACT", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2213 { "en", "Australia/ACT", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2214 { "en", "Australia/ACT", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2215 { "en", "Australia/ACT", "2004-01-15T00:00:00Z", "V", "AEDT", "+11:00" },
2216 { "en", "Australia/ACT", "2004-01-15T00:00:00Z", "zzzz", "Australian Eastern Daylight Time", "+11:00" },
2217 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2218 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2219 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2220 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "V", "AEST", "+10:00" },
2221 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "zzzz", "Australian Eastern Standard Time", "+10:00" },
2222 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "v", "Australia (Sydney)", "Australia/Sydney" },
2223 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "vvvv", "Eastern Australia Time", "Australia/Sydney" },
2224 { "en", "Australia/ACT", "2004-07-15T00:00:00Z", "VVVV", "Australia (Sydney)", "Australia/Sydney" },
2225
2226 { "en", "Australia/Sydney", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2227 { "en", "Australia/Sydney", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2228 { "en", "Australia/Sydney", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2229 { "en", "Australia/Sydney", "2004-01-15T00:00:00Z", "V", "AEDT", "+11:00" },
2230 { "en", "Australia/Sydney", "2004-01-15T00:00:00Z", "zzzz", "Australian Eastern Daylight Time", "+11:00" },
2231 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2232 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2233 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2234 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "V", "AEST", "+10:00" },
2235 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "zzzz", "Australian Eastern Standard Time", "+10:00" },
2236 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "v", "Australia (Sydney)", "Australia/Sydney" },
2237 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "Eastern Australia Time", "Australia/Sydney" },
2238 { "en", "Australia/Sydney", "2004-07-15T00:00:00Z", "VVVV", "Australia (Sydney)", "Australia/Sydney" },
2239
2240 { "en", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" },
2241 { "en", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" },
2242 { "en", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT", "+0:00" },
2243 { "en", "Europe/London", "2004-01-15T00:00:00Z", "V", "GMT", "+0:00" },
2244 { "en", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "Greenwich Mean Time", "+0:00" },
2245 { "en", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" },
2246 { "en", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" },
2247 { "en", "Europe/London", "2004-07-15T00:00:00Z", "z", "GMT+01:00", "Europe/London" },
2248 { "en", "Europe/London", "2004-07-15T00:00:00Z", "V", "BST", "Europe/London" },
2249 { "en", "Europe/London", "2004-07-15T00:00:00Z", "zzzz", "British Summer Time", "Europe/London" },
2250 // icu en.txt has exemplar city for this time zone
2251 { "en", "Europe/London", "2004-07-15T00:00:00Z", "v", "United Kingdom Time", "Europe/London" },
2252 { "en", "Europe/London", "2004-07-15T00:00:00Z", "vvvv", "United Kingdom Time", "Europe/London" },
2253 { "en", "Europe/London", "2004-07-15T00:00:00Z", "VVVV", "United Kingdom Time", "Europe/London" },
2254
2255 { "en", "Etc/GMT+3", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2256 { "en", "Etc/GMT+3", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2257 { "en", "Etc/GMT+3", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2258 { "en", "Etc/GMT+3", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2259 { "en", "Etc/GMT+3", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2260 { "en", "Etc/GMT+3", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2261 { "en", "Etc/GMT+3", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2262 { "en", "Etc/GMT+3", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2263 { "en", "Etc/GMT+3", "2004-07-15T00:00:00Z", "v", "GMT-03:00", "-3:00" },
2264 { "en", "Etc/GMT+3", "2004-07-15T00:00:00Z", "vvvv", "GMT-03:00", "-3:00" },
2265
2266 // JB#5150
2267 { "en", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" },
2268 { "en", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2269 { "en", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "GMT+05:30", "+5:30" },
2270 { "en", "Asia/Calcutta", "2004-01-15T00:00:00Z", "V", "IST", "+5:30" },
2271 { "en", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "India Standard Time", "+5:30" },
2272 { "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" },
2273 { "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2274 { "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+05:30", "+05:30" },
2275 { "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "V", "IST", "+05:30" },
2276 { "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "India Standard Time", "+5:30" },
2277 { "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "India Time", "Asia/Calcutta" },
2278 { "en", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "India Standard Time", "Asia/Calcutta" },
2279
2280 // ==========
2281
2282 { "de", "America/Los_Angeles", "2004-01-15T00:00:00Z", "Z", "-0800", "-8:00" },
2283 { "de", "America/Los_Angeles", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-08:00", "-8:00" },
2284 { "de", "America/Los_Angeles", "2004-01-15T00:00:00Z", "z", "GMT-08:00", "-8:00" },
2285 { "de", "America/Los_Angeles", "2004-01-15T00:00:00Z", "zzzz", "GMT-08:00", "-8:00" },
2286 { "de", "America/Los_Angeles", "2004-07-15T00:00:00Z", "Z", "-0700", "-7:00" },
2287 { "de", "America/Los_Angeles", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-07:00", "-7:00" },
2288 { "de", "America/Los_Angeles", "2004-07-15T00:00:00Z", "z", "GMT-07:00", "-7:00" },
2289 { "de", "America/Los_Angeles", "2004-07-15T00:00:00Z", "zzzz", "GMT-07:00", "-7:00" },
2290 { "de", "America/Los_Angeles", "2004-07-15T00:00:00Z", "v", "Vereinigte Staaten (Los Angeles)", "America/Los_Angeles" },
2291 { "de", "America/Los_Angeles", "2004-07-15T00:00:00Z", "vvvv", "Vereinigte Staaten (Los Angeles)", "America/Los_Angeles" },
2292
2293 { "de", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2294 { "de", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2295 { "de", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2296 { "de", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2297 { "de", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2298 { "de", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2299 { "de", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2300 { "de", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2301 { "de", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "Argentinien (Buenos Aires)", "America/Buenos_Aires" },
2302 { "de", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "Argentinien (Buenos Aires)", "America/Buenos_Aires" },
2303
2304 { "de", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2305 { "de", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2306 { "de", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2307 { "de", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2308 { "de", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2309 { "de", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2310 { "de", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2311 { "de", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2312 { "de", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "Argentinien (Buenos Aires)", "America/Buenos_Aires" },
2313 { "de", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "Argentinien (Buenos Aires)", "America/Buenos_Aires" },
2314
2315 { "de", "America/Havana", "2004-01-15T00:00:00Z", "Z", "-0500", "-5:00" },
2316 { "de", "America/Havana", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-05:00", "-5:00" },
2317 { "de", "America/Havana", "2004-01-15T00:00:00Z", "z", "GMT-05:00", "-5:00" },
2318 { "de", "America/Havana", "2004-01-15T00:00:00Z", "zzzz", "GMT-05:00", "-5:00" },
2319 { "de", "America/Havana", "2004-07-15T00:00:00Z", "Z", "-0400", "-4:00" },
2320 { "de", "America/Havana", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-04:00", "-4:00" },
2321 { "de", "America/Havana", "2004-07-15T00:00:00Z", "z", "GMT-04:00", "-4:00" },
2322 { "de", "America/Havana", "2004-07-15T00:00:00Z", "zzzz", "GMT-04:00", "-4:00" },
2323 { "de", "America/Havana", "2004-07-15T00:00:00Z", "v", "Kuba", "America/Havana" },
2324 { "de", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "Kuba", "America/Havana" },
2325 // added to test proper fallback of country name
2326 { "de_CH", "America/Havana", "2004-07-15T00:00:00Z", "v", "Kuba", "America/Havana" },
2327 { "de_CH", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "Kuba", "America/Havana" },
2328
2329 { "de", "Australia/ACT", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2330 { "de", "Australia/ACT", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2331 { "de", "Australia/ACT", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2332 { "de", "Australia/ACT", "2004-01-15T00:00:00Z", "zzzz", "GMT+11:00", "+11:00" },
2333 { "de", "Australia/ACT", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2334 { "de", "Australia/ACT", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2335 { "de", "Australia/ACT", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2336 { "de", "Australia/ACT", "2004-07-15T00:00:00Z", "zzzz", "GMT+10:00", "+10:00" },
2337 { "de", "Australia/ACT", "2004-07-15T00:00:00Z", "v", "Australien (Sydney)", "Australia/Sydney" },
2338 { "de", "Australia/ACT", "2004-07-15T00:00:00Z", "vvvv", "Australien (Sydney)", "Australia/Sydney" },
2339
2340 { "de", "Australia/Sydney", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2341 { "de", "Australia/Sydney", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2342 { "de", "Australia/Sydney", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2343 { "de", "Australia/Sydney", "2004-01-15T00:00:00Z", "zzzz", "GMT+11:00", "+11:00" },
2344 { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2345 { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2346 { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2347 { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "zzzz", "GMT+10:00", "+10:00" },
2348 { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "v", "Australien (Sydney)", "Australia/Sydney" },
2349 { "de", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "Australien (Sydney)", "Australia/Sydney" },
2350
2351 { "de", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" },
2352 { "de", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" },
2353 { "de", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+00:00", "+0:00" },
2354 { "de", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "GMT+00:00", "+0:00" },
2355 { "de", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" },
2356 { "de", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" },
2357 { "de", "Europe/London", "2004-07-15T00:00:00Z", "z", "GMT+01:00", "+1:00" },
2358 { "de", "Europe/London", "2004-07-15T00:00:00Z", "zzzz", "GMT+01:00", "+1:00" },
2359 { "de", "Europe/London", "2004-07-15T00:00:00Z", "v", "Vereinigtes K\\u00f6nigreich", "Europe/London" },
2360 { "de", "Europe/London", "2004-07-15T00:00:00Z", "vvvv", "Vereinigtes K\\u00f6nigreich", "Europe/London" },
2361
2362 { "de", "Etc/GMT+3", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2363 { "de", "Etc/GMT+3", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2364 { "de", "Etc/GMT+3", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2365 { "de", "Etc/GMT+3", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2366 { "de", "Etc/GMT+3", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2367 { "de", "Etc/GMT+3", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2368 { "de", "Etc/GMT+3", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2369 { "de", "Etc/GMT+3", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2370 { "de", "Etc/GMT+3", "2004-07-15T00:00:00Z", "v", "GMT-03:00", "-3:00" },
2371 { "de", "Etc/GMT+3", "2004-07-15T00:00:00Z", "vvvv", "GMT-03:00", "-3:00" },
2372
2373 // JB#5150
2374 { "de", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" },
2375 { "de", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2376 { "de", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "GMT+05:30", "+5:30" },
2377 { "de", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "GMT+05:30", "+5:30" },
2378 { "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" },
2379 { "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2380 { "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+05:30", "+05:30" },
2381 { "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "GMT+05:30", "+5:30" },
2382 { "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "Indien", "Asia/Calcutta" },
2383 { "de", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "Indien", "Asia/Calcutta" },
2384
2385 // ==========
2386
2387 { "zh", "America/Los_Angeles", "2004-01-15T00:00:00Z", "Z", "-0800", "-8:00" },
2388 { "zh", "America/Los_Angeles", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800", "-8:00" },
2389 { "zh", "America/Los_Angeles", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0800", "America/Los_Angeles" },
2390 { "zh", "America/Los_Angeles", "2004-01-15T00:00:00Z", "zzzz", "\\u592a\\u5e73\\u6d0b\\u6807\\u51c6\\u65f6\\u95f4", "America/Los_Angeles" },
2391 { "zh", "America/Los_Angeles", "2004-07-15T00:00:00Z", "Z", "-0700", "-7:00" },
2392 { "zh", "America/Los_Angeles", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0700", "-7:00" },
2393 { "zh", "America/Los_Angeles", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0700", "America/Los_Angeles" },
2394 { "zh", "America/Los_Angeles", "2004-07-15T00:00:00Z", "zzzz", "\\u592a\\u5e73\\u6d0b\\u590f\\u4ee4\\u65f6\\u95f4", "America/Los_Angeles" },
2395 // icu zh.txt has exemplar city for this time zone
2396 { "zh", "America/Los_Angeles", "2004-07-15T00:00:00Z", "v", "\\u7f8e\\u56fd (\\u6d1b\\u6749\\u77f6)", "America/Los_Angeles" },
2397 { "zh", "America/Los_Angeles", "2004-07-15T00:00:00Z", "vvvv", "\\u7f8e\\u56fd\\u592a\\u5e73\\u6d0b\\u65f6\\u95f4", "America/Los_Angeles" },
2398
2399 { "zh", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2400 { "zh", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2401 { "zh", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2402 { "zh", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "\\u963f\\u6839\\u5ef7\\u6807\\u51c6\\u65f6\\u95f4", "-3:00" },
2403 { "zh", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2404 { "zh", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2405 { "zh", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2406 { "zh", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "\\u963f\\u6839\\u5ef7\\u6807\\u51c6\\u65f6\\u95f4", "-3:00" },
2407 { "zh", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u963f\\u6839\\u5ef7 (\\u5e03\\u5b9c\\u8bfa\\u65af\\u827e\\u5229\\u65af)", "America/Buenos_Aires" },
2408 { "zh", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u963f\\u6839\\u5ef7\\u6807\\u51c6\\u65f6\\u95f4", "America/Buenos_Aires" },
2409
2410 { "zh", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2411 { "zh", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2412 { "zh", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2413 { "zh", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "\\u963f\\u6839\\u5ef7\\u6807\\u51c6\\u65f6\\u95f4", "-3:00" },
2414 { "zh", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2415 { "zh", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2416 { "zh", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2417 { "zh", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "\\u963f\\u6839\\u5ef7\\u6807\\u51c6\\u65f6\\u95f4", "-3:00" },
2418 { "zh", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u963f\\u6839\\u5ef7 (\\u5e03\\u5b9c\\u8bfa\\u65af\\u827e\\u5229\\u65af)", "America/Buenos_Aires" },
2419 { "zh", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u963f\\u6839\\u5ef7\\u6807\\u51c6\\u65f6\\u95f4", "America/Buenos_Aires" },
2420
2421 { "zh", "America/Havana", "2004-01-15T00:00:00Z", "Z", "-0500", "-5:00" },
2422 { "zh", "America/Havana", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0500", "-5:00" },
2423 { "zh", "America/Havana", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0500", "-5:00" },
2424 { "zh", "America/Havana", "2004-01-15T00:00:00Z", "zzzz", "\\u53e4\\u5df4\\u6a19\\u6e96\\u6642\\u9593", "-5:00" },
2425 { "zh", "America/Havana", "2004-07-15T00:00:00Z", "Z", "-0400", "-4:00" },
2426 { "zh", "America/Havana", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0400", "-4:00" },
2427 { "zh", "America/Havana", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0400", "-4:00" },
2428 { "zh", "America/Havana", "2004-07-15T00:00:00Z", "zzzz", "\\u53e4\\u5df4\\u590f\\u4ee4\\u6642\\u9593", "-4:00" },
2429 { "zh", "America/Havana", "2004-07-15T00:00:00Z", "v", "\\u53e4\\u5df4", "America/Havana" },
2430 { "zh", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "\\u53e4\\u5df4\\u6642\\u9593", "America/Havana" },
2431
2432 { "zh", "Australia/ACT", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2433 { "zh", "Australia/ACT", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1100", "+11:00" },
2434 { "zh", "Australia/ACT", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1100", "+11:00" },
2435 { "zh", "Australia/ACT", "2004-01-15T00:00:00Z", "zzzz", "\\u6fb3\\u5927\\u5229\\u4e9a\\u4e1c\\u90e8\\u590f\\u4ee4\\u65f6\\u95f4", "+11:00" },
2436 { "zh", "Australia/ACT", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2437 { "zh", "Australia/ACT", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1000", "+10:00" },
2438 { "zh", "Australia/ACT", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1000", "+10:00" },
2439 { "zh", "Australia/ACT", "2004-07-15T00:00:00Z", "zzzz", "\\u6fb3\\u5927\\u5229\\u4e9a\\u4e1c\\u90e8\\u6807\\u51c6\\u65f6\\u95f4", "+10:00" },
2440 // icu zh.txt does not have info for this time zone
2441 { "zh", "Australia/ACT", "2004-07-15T00:00:00Z", "v", "\\u6fb3\\u5927\\u5229\\u4e9a (\\u6089\\u5c3c)", "Australia/Sydney" },
2442 { "zh", "Australia/ACT", "2004-07-15T00:00:00Z", "vvvv", "\\u6fb3\\u5927\\u5229\\u4e9a\\u4e1c\\u90e8\\u65f6\\u95f4", "Australia/Sydney" },
2443
2444 { "zh", "Australia/Sydney", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2445 { "zh", "Australia/Sydney", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1100", "+11:00" },
2446 { "zh", "Australia/Sydney", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1100", "+11:00" },
2447 { "zh", "Australia/Sydney", "2004-01-15T00:00:00Z", "zzzz", "\\u6fb3\\u5927\\u5229\\u4e9a\\u4e1c\\u90e8\\u590f\\u4ee4\\u65f6\\u95f4", "+11:00" },
2448 { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2449 { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1000", "+10:00" },
2450 { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+1000", "+10:00" },
2451 { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "zzzz", "\\u6fb3\\u5927\\u5229\\u4e9a\\u4e1c\\u90e8\\u6807\\u51c6\\u65f6\\u95f4", "+10:00" },
2452 { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "v", "\\u6fb3\\u5927\\u5229\\u4e9a (\\u6089\\u5c3c)", "Australia/Sydney" },
2453 { "zh", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u6fb3\\u5927\\u5229\\u4e9a\\u4e1c\\u90e8\\u65f6\\u95f4", "Australia/Sydney" },
2454
2455 { "zh", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" },
2456 { "zh", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0000", "+0:00" },
2457 { "zh", "Europe/London", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0000", "+0:00" },
2458 { "zh", "Europe/London", "2004-01-15T00:00:00Z", "V", "GMT", "+0:00" },
2459 { "zh", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\\u683C\\u6797\\u5C3C\\u6CBB\\u6807\\u51C6\\u65F6\\u95F4", "+0:00" },
2460 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" },
2461 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0100", "+1:00" },
2462 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0100", "+1:00" },
2463 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "V", "BST", "+1:00" },
2464 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "zzzz", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0100", "+1:00" },
2465 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "v", "\\u82f1\\u56fd", "Europe/London" },
2466 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "vvvv", "\\u82f1\\u56fd", "Europe/London" },
2467 { "zh", "Europe/London", "2004-07-15T00:00:00Z", "VVVV", "\\u82f1\\u56fd", "Europe/London" },
2468
2469 { "zh", "Etc/GMT+3", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2470 { "zh", "Etc/GMT+3", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2471 { "zh", "Etc/GMT+3", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2472 { "zh", "Etc/GMT+3", "2004-01-15T00:00:00Z", "zzzz", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2473 { "zh", "Etc/GMT+3", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2474 { "zh", "Etc/GMT+3", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2475 { "zh", "Etc/GMT+3", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2476 { "zh", "Etc/GMT+3", "2004-07-15T00:00:00Z", "zzzz", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2477 { "zh", "Etc/GMT+3", "2004-07-15T00:00:00Z", "v", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2478 { "zh", "Etc/GMT+3", "2004-07-15T00:00:00Z", "vvvv", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4-0300", "-3:00" },
2479
2480 // JB#5150
2481 { "zh", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" },
2482 { "zh", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0530", "+5:30" },
2483 { "zh", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0530", "+5:30" },
2484 { "zh", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\\u5370\\u5ea6\\u6807\\u51c6\\u65f6\\u95f4", "+5:30" },
2485 { "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" },
2486 { "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0530", "+5:30" },
2487 { "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "\\u683c\\u6797\\u5c3c\\u6cbb\\u6807\\u51c6\\u65f6\\u95f4+0530", "+05:30" },
2488 { "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\\u5370\\u5ea6\\u6807\\u51c6\\u65f6\\u95f4", "+5:30" },
2489 { "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\\u5370\\u5ea6", "Asia/Calcutta" },
2490 { "zh", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\\u5370\\u5ea6\\u6807\\u51c6\\u65f6\\u95f4", "Asia/Calcutta" },
2491
2492 // ==========
2493
2494 { "hi", "America/Los_Angeles", "2004-01-15T00:00:00Z", "Z", "-0800", "-8:00" },
2495 { "hi", "America/Los_Angeles", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u096e:\\u0966\\u0966", "-8:00" },
2496 { "hi", "America/Los_Angeles", "2004-01-15T00:00:00Z", "z", "GMT-\\u0966\\u096e:\\u0966\\u0966", "-8:00" },
2497 { "hi", "America/Los_Angeles", "2004-01-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u096e:\\u0966\\u0966", "-8:00" },
2498 { "hi", "America/Los_Angeles", "2004-07-15T00:00:00Z", "Z", "-0700", "-7:00" },
2499 { "hi", "America/Los_Angeles", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u096d:\\u0966\\u0966", "-7:00" },
2500 { "hi", "America/Los_Angeles", "2004-07-15T00:00:00Z", "z", "GMT-\\u0966\\u096d:\\u0966\\u0966", "-7:00" },
2501 { "hi", "America/Los_Angeles", "2004-07-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u096d:\\u0966\\u0966", "-7:00" },
2502 { "hi", "America/Los_Angeles", "2004-07-15T00:00:00Z", "v", "\\u0938\\u0902\\u092f\\u0941\\u0915\\u094d\\u0924 \\u0930\\u093e\\u091c\\u094d\\u092f \\u0905\\u092e\\u0930\\u093f\\u0915\\u093e (\\u0932\\u094b\\u0938 \\u090f\\u0902\\u091c\\u093f\\u0932\\u0947\\u0938)", "America/Los_Angeles" },
2503 { "hi", "America/Los_Angeles", "2004-07-15T00:00:00Z", "vvvv", "\\u0938\\u0902\\u092f\\u0941\\u0915\\u094d\\u0924 \\u0930\\u093e\\u091c\\u094d\\u092f \\u0905\\u092e\\u0930\\u093f\\u0915\\u093e (\\u0932\\u094b\\u0938 \\u090f\\u0902\\u091c\\u093f\\u0932\\u0947\\u0938)", "America/Los_Angeles" },
2504
2505 { "hi", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2506 { "hi", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2507 { "hi", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2508 { "hi", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2509 { "hi", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2510 { "hi", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2511 { "hi", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2512 { "hi", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2513 { "hi", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u0905\\u0930\\u094d\\u091c\\u0947\\u0928\\u094d\\u091f\\u0940\\u0928\\u093e (\\u092c\\u094d\\u092f\\u0942\\u0928\\u0938 \\u0906\\u092f\\u0930\\u0938)", "America/Buenos_Aires" },
2514 { "hi", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u0905\\u0930\\u094d\\u091c\\u0947\\u0928\\u094d\\u091f\\u0940\\u0928\\u093e (\\u092c\\u094d\\u092f\\u0942\\u0928\\u0938 \\u0906\\u092f\\u0930\\u0938)", "America/Buenos_Aires" },
2515
2516 { "hi", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2517 { "hi", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2518 { "hi", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2519 { "hi", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2520 { "hi", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2521 { "hi", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2522 { "hi", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2523 { "hi", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2524 { "hi", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u0905\\u0930\\u094d\\u091c\\u0947\\u0928\\u094d\\u091f\\u0940\\u0928\\u093e (\\u092c\\u094d\\u092f\\u0942\\u0928\\u0938 \\u0906\\u092f\\u0930\\u0938)", "America/Buenos_Aires" },
2525 { "hi", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u0905\\u0930\\u094d\\u091c\\u0947\\u0928\\u094d\\u091f\\u0940\\u0928\\u093e (\\u092c\\u094d\\u092f\\u0942\\u0928\\u0938 \\u0906\\u092f\\u0930\\u0938)", "America/Buenos_Aires" },
2526
2527 { "hi", "America/Havana", "2004-01-15T00:00:00Z", "Z", "-0500", "-5:00" },
2528 { "hi", "America/Havana", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u096b:\\u0966\\u0966", "-5:00" },
2529 { "hi", "America/Havana", "2004-01-15T00:00:00Z", "z", "GMT-\\u0966\\u096b:\\u0966\\u0966", "-5:00" },
2530 { "hi", "America/Havana", "2004-01-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u096b:\\u0966\\u0966", "-5:00" },
2531 { "hi", "America/Havana", "2004-07-15T00:00:00Z", "Z", "-0400", "-4:00" },
2532 { "hi", "America/Havana", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u096a:\\u0966\\u0966", "-4:00" },
2533 { "hi", "America/Havana", "2004-07-15T00:00:00Z", "z", "GMT-\\u0966\\u096a:\\u0966\\u0966", "-4:00" },
2534 { "hi", "America/Havana", "2004-07-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u096a:\\u0966\\u0966", "-4:00" },
2535 { "hi", "America/Havana", "2004-07-15T00:00:00Z", "v", "\\u0915\\u094d\\u092f\\u0942\\u092c\\u093e", "America/Havana" },
2536 { "hi", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "\\u0915\\u094d\\u092f\\u0942\\u092c\\u093e", "America/Havana" },
2537
2538 { "hi", "Australia/ACT", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2539 { "hi", "Australia/ACT", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+\\u0967\\u0967:\\u0966\\u0966", "+11:00" },
2540 { "hi", "Australia/ACT", "2004-01-15T00:00:00Z", "z", "GMT+\\u0967\\u0967:\\u0966\\u0966", "+11:00" },
2541 { "hi", "Australia/ACT", "2004-01-15T00:00:00Z", "zzzz", "GMT+\\u0967\\u0967:\\u0966\\u0966", "+11:00" },
2542 { "hi", "Australia/ACT", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2543 { "hi", "Australia/ACT", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+\\u0967\\u0966:\\u0966\\u0966", "+10:00" },
2544 { "hi", "Australia/ACT", "2004-07-15T00:00:00Z", "z", "GMT+\\u0967\\u0966:\\u0966\\u0966", "+10:00" },
2545 { "hi", "Australia/ACT", "2004-07-15T00:00:00Z", "zzzz", "GMT+\\u0967\\u0966:\\u0966\\u0966", "+10:00" },
2546 { "hi", "Australia/ACT", "2004-07-15T00:00:00Z", "v", "\\u0911\\u0938\\u094d\\u091f\\u094d\\u0930\\u0947\\u0932\\u093f\\u092f\\u093e (\\u0938\\u093f\\u0921\\u0928\\u0940)", "Australia/Sydney" },
2547 { "hi", "Australia/ACT", "2004-07-15T00:00:00Z", "vvvv", "\\u0911\\u0938\\u094d\\u091f\\u094d\\u0930\\u0947\\u0932\\u093f\\u092f\\u093e (\\u0938\\u093f\\u0921\\u0928\\u0940)", "Australia/Sydney" },
2548
2549 { "hi", "Australia/Sydney", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2550 { "hi", "Australia/Sydney", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+\\u0967\\u0967:\\u0966\\u0966", "+11:00" },
2551 { "hi", "Australia/Sydney", "2004-01-15T00:00:00Z", "z", "GMT+\\u0967\\u0967:\\u0966\\u0966", "+11:00" },
2552 { "hi", "Australia/Sydney", "2004-01-15T00:00:00Z", "zzzz", "GMT+\\u0967\\u0967:\\u0966\\u0966", "+11:00" },
2553 { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2554 { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+\\u0967\\u0966:\\u0966\\u0966", "+10:00" },
2555 { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "z", "GMT+\\u0967\\u0966:\\u0966\\u0966", "+10:00" },
2556 { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "zzzz", "GMT+\\u0967\\u0966:\\u0966\\u0966", "+10:00" },
2557 { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "v", "\\u0911\\u0938\\u094d\\u091f\\u094d\\u0930\\u0947\\u0932\\u093f\\u092f\\u093e (\\u0938\\u093f\\u0921\\u0928\\u0940)", "Australia/Sydney" },
2558 { "hi", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u0911\\u0938\\u094d\\u091f\\u094d\\u0930\\u0947\\u0932\\u093f\\u092f\\u093e (\\u0938\\u093f\\u0921\\u0928\\u0940)", "Australia/Sydney" },
2559
2560 { "hi", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" },
2561 { "hi", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+\\u0966\\u0966:\\u0966\\u0966", "+0:00" },
2562 { "hi", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+\\u0966\\u0966:\\u0966\\u0966", "+0:00" },
2563 { "hi", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "GMT+\\u0966\\u0966:\\u0966\\u0966", "+0:00" },
2564 { "hi", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" },
2565 { "hi", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+\\u0966\\u0967:\\u0966\\u0966", "+1:00" },
2566 { "hi", "Europe/London", "2004-07-15T00:00:00Z", "z", "GMT+\\u0966\\u0967:\\u0966\\u0966", "+1:00" },
2567 { "hi", "Europe/London", "2004-07-15T00:00:00Z", "zzzz", "GMT+\\u0966\\u0967:\\u0966\\u0966", "+1:00" },
2568 { "hi", "Europe/London", "2004-07-15T00:00:00Z", "v", "\\u092C\\u094D\\u0930\\u093F\\u0924\\u0928", "Europe/London" },
2569 { "hi", "Europe/London", "2004-07-15T00:00:00Z", "vvvv", "\\u092C\\u094D\\u0930\\u093F\\u0924\\u0928", "Europe/London" },
2570
2571 { "hi", "Etc/GMT+3", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2572 { "hi", "Etc/GMT+3", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2573 { "hi", "Etc/GMT+3", "2004-01-15T00:00:00Z", "z", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2574 { "hi", "Etc/GMT+3", "2004-01-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2575 { "hi", "Etc/GMT+3", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2576 { "hi", "Etc/GMT+3", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2577 { "hi", "Etc/GMT+3", "2004-07-15T00:00:00Z", "z", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2578 { "hi", "Etc/GMT+3", "2004-07-15T00:00:00Z", "zzzz", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2579 { "hi", "Etc/GMT+3", "2004-07-15T00:00:00Z", "v", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2580 { "hi", "Etc/GMT+3", "2004-07-15T00:00:00Z", "vvvv", "GMT-\\u0966\\u0969:\\u0966\\u0966", "-3:00" },
2581
2582 { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" },
2583 { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+\\u0966\\u096B:\\u0969\\u0966", "+5:30" },
2584 { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "IST", "+5:30" },
2585 { "hi", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\\u092D\\u093E\\u0930\\u0924\\u0940\\u092F \\u0938\\u092E\\u092F", "+5:30" },
2586 { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" },
2587 { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+\\u0966\\u096B:\\u0969\\u0966", "+5:30" },
2588 { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "IST", "+05:30" },
2589 { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\\u092D\\u093E\\u0930\\u0924\\u0940\\u092F \\u0938\\u092E\\u092F", "+5:30" },
2590 { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "IST", "Asia/Calcutta" },
2591 { "hi", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\\u092D\\u093E\\u0930\\u0924\\u0940\\u092F \\u0938\\u092E\\u092F", "Asia/Calcutta" },
2592
2593 // ==========
2594
2595 { "bg", "America/Los_Angeles", "2004-01-15T00:00:00Z", "Z", "-0800", "-8:00" },
2596 { "bg", "America/Los_Angeles", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0800", "-8:00" },
2597 { "bg", "America/Los_Angeles", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0800", "America/Los_Angeles" },
2598 { "bg", "America/Los_Angeles", "2004-01-15T00:00:00Z", "V", "PST", "America/Los_Angeles" },
2599 { "bg", "America/Los_Angeles", "2004-01-15T00:00:00Z", "zzzz", "\\u0422\\u0438\\u0445\\u043E\\u043E\\u043A\\u0435\\u0430\\u043D\\u0441\\u043A\\u0430 \\u0447\\u0430\\u0441\\u043E\\u0432\\u0430 \\u0437\\u043E\\u043D\\u0430", "America/Los_Angeles" },
2600 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "Z", "-0700", "-7:00" },
2601 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0700", "-7:00" },
2602 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0700", "America/Los_Angeles" },
2603 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "V", "PDT", "America/Los_Angeles" },
2604 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "zzzz", "\\u0422\\u0438\\u0445\\u043E\\u043E\\u043A\\u0435\\u0430\\u043D\\u0441\\u043A\\u0430 \\u043B\\u044F\\u0442\\u043D\\u0430 \\u0447\\u0430\\u0441\\u043E\\u0432\\u0430 \\u0437\\u043E\\u043D\\u0430", "America/Los_Angeles" },
2605 // icu bg.txt has exemplar city for this time zone
2606 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "v", "\\u0421\\u0410\\u0429 (\\u041b\\u043e\\u0441 \\u0410\\u043d\\u0436\\u0435\\u043b\\u0438\\u0441)", "America/Los_Angeles" },
2607 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "vvvv", "\\u0421\\u0410\\u0429 (\\u041b\\u043e\\u0441 \\u0410\\u043d\\u0436\\u0435\\u043b\\u0438\\u0441)", "America/Los_Angeles" },
2608 { "bg", "America/Los_Angeles", "2004-07-15T00:00:00Z", "VVVV", "\\u0421\\u0410\\u0429 (\\u041b\\u043e\\u0441 \\u0410\\u043d\\u0436\\u0435\\u043b\\u0438\\u0441)", "America/Los_Angeles" },
2609
2610 { "bg", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2611 { "bg", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2612 { "bg", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2613 { "bg", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2614 { "bg", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2615 { "bg", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2616 { "bg", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2617 { "bg", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2618 { "bg", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u0410\\u0440\\u0436\\u0435\\u043d\\u0442\\u0438\\u043d\\u0430 (\\u0411\\u0443\\u0435\\u043D\\u043E\\u0441 \\u0410\\u0439\\u0440\\u0435\\u0441)", "America/Buenos_Aires" },
2619 { "bg", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u0410\\u0440\\u0436\\u0435\\u043d\\u0442\\u0438\\u043d\\u0430 (\\u0411\\u0443\\u0435\\u043D\\u043E\\u0441 \\u0410\\u0439\\u0440\\u0435\\u0441)", "America/Buenos_Aires" },
2620
2621 { "bg", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2622 { "bg", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2623 { "bg", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2624 { "bg", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2625 { "bg", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2626 { "bg", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2627 { "bg", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2628 { "bg", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2629 // icu bg.txt does not have info for this time zone
2630 { "bg", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u0410\\u0440\\u0436\\u0435\\u043d\\u0442\\u0438\\u043d\\u0430 (\\u0411\\u0443\\u0435\\u043D\\u043E\\u0441 \\u0410\\u0439\\u0440\\u0435\\u0441)", "America/Buenos_Aires" },
2631 { "bg", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u0410\\u0440\\u0436\\u0435\\u043d\\u0442\\u0438\\u043d\\u0430 (\\u0411\\u0443\\u0435\\u043D\\u043E\\u0441 \\u0410\\u0439\\u0440\\u0435\\u0441)", "America/Buenos_Aires" },
2632
2633 { "bg", "America/Havana", "2004-01-15T00:00:00Z", "Z", "-0500", "-5:00" },
2634 { "bg", "America/Havana", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0500", "-5:00" },
2635 { "bg", "America/Havana", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0500", "-5:00" },
2636 { "bg", "America/Havana", "2004-01-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0500", "-5:00" },
2637 { "bg", "America/Havana", "2004-07-15T00:00:00Z", "Z", "-0400", "-4:00" },
2638 { "bg", "America/Havana", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0400", "-4:00" },
2639 { "bg", "America/Havana", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0400", "-4:00" },
2640 { "bg", "America/Havana", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0400", "-4:00" },
2641 { "bg", "America/Havana", "2004-07-15T00:00:00Z", "v", "\\u041a\\u0443\\u0431\\u0430", "America/Havana" },
2642 { "bg", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "\\u041a\\u0443\\u0431\\u0430", "America/Havana" },
2643
2644 { "bg", "Australia/ACT", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2645 { "bg", "Australia/ACT", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1100", "+11:00" },
2646 { "bg", "Australia/ACT", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1100", "+11:00" },
2647 { "bg", "Australia/ACT", "2004-01-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1100", "+11:00" },
2648 { "bg", "Australia/ACT", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2649 { "bg", "Australia/ACT", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1000", "+10:00" },
2650 { "bg", "Australia/ACT", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1000", "+10:00" },
2651 { "bg", "Australia/ACT", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1000", "+10:00" },
2652 { "bg", "Australia/ACT", "2004-07-15T00:00:00Z", "v", "\\u0410\\u0432\\u0441\\u0442\\u0440\\u0430\\u043b\\u0438\\u044f (\\u0421\\u0438\\u0434\\u043D\\u0438)", "Australia/Sydney" },
2653 { "bg", "Australia/ACT", "2004-07-15T00:00:00Z", "vvvv", "\\u0410\\u0432\\u0441\\u0442\\u0440\\u0430\\u043b\\u0438\\u044f (\\u0421\\u0438\\u0434\\u043D\\u0438)", "Australia/Sydney" },
2654
2655 { "bg", "Australia/Sydney", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2656 { "bg", "Australia/Sydney", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1100", "+11:00" },
2657 { "bg", "Australia/Sydney", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1100", "+11:00" },
2658 { "bg", "Australia/Sydney", "2004-01-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1100", "+11:00" },
2659 { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2660 { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1000", "+10:00" },
2661 { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1000", "+10:00" },
2662 { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+1000", "+10:00" },
2663 { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "v", "\\u0410\\u0432\\u0441\\u0442\\u0440\\u0430\\u043b\\u0438\\u044f (\\u0421\\u0438\\u0434\\u043D\\u0438)", "Australia/Sydney" },
2664 { "bg", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u0410\\u0432\\u0441\\u0442\\u0440\\u0430\\u043b\\u0438\\u044f (\\u0421\\u0438\\u0434\\u043D\\u0438)", "Australia/Sydney" },
2665
2666 { "bg", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" },
2667 { "bg", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0000", "+0:00" },
2668 { "bg", "Europe/London", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0000", "+0:00" },
2669 { "bg", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\\u0427\\u0430\\u0441\\u043E\\u0432\\u0430 \\u0437\\u043E\\u043D\\u0430 \\u0413\\u0440\\u0438\\u043D\\u0443\\u0438\\u0447", "+0:00" },
2670 { "bg", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" },
2671 { "bg", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0100", "+1:00" },
2672 { "bg", "Europe/London", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0100", "+1:00" },
2673 { "bg", "Europe/London", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0100", "+1:00" },
2674 { "bg", "Europe/London", "2004-07-15T00:00:00Z", "v", "\\u041e\\u0431\\u0435\\u0434\\u0438\\u043d\\u0435\\u043d\\u043e \\u043a\\u0440\\u0430\\u043b\\u0441\\u0442\\u0432\\u043e", "Europe/London" },
2675 { "bg", "Europe/London", "2004-07-15T00:00:00Z", "vvvv", "\\u041e\\u0431\\u0435\\u0434\\u0438\\u043d\\u0435\\u043d\\u043e \\u043a\\u0440\\u0430\\u043b\\u0441\\u0442\\u0432\\u043e", "Europe/London" },
2676
2677 { "bg", "Etc/GMT+3", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2678 { "bg", "Etc/GMT+3", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2679 { "bg", "Etc/GMT+3", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2680 { "bg", "Etc/GMT+3", "2004-01-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2681 { "bg", "Etc/GMT+3", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2682 { "bg", "Etc/GMT+3", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2683 { "bg", "Etc/GMT+3", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2684 { "bg", "Etc/GMT+3", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2685 { "bg", "Etc/GMT+3", "2004-07-15T00:00:00Z", "v", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2686 { "bg", "Etc/GMT+3", "2004-07-15T00:00:00Z", "vvvv", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447-0300", "-3:00" },
2687
2688 // JB#5150
2689 { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" },
2690 { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0530", "+5:30" },
2691 { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0530", "+5:30" },
2692 { "bg", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0530", "+5:30" },
2693 { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" },
2694 { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0530", "+5:30" },
2695 { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0530", "+05:30" },
2696 { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "\\u0413\\u0440\\u0438\\u0438\\u043D\\u0443\\u0438\\u0447+0530", "+5:30" },
2697 { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\\u0418\\u043D\\u0434\\u0438\\u044F", "Asia/Calcutta" },
2698 { "bg", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\\u0418\\u043D\\u0434\\u0438\\u044F", "Asia/Calcutta" },
2699 // ==========
2700
2701 { "ja", "America/Los_Angeles", "2004-01-15T00:00:00Z", "Z", "-0800", "-8:00" },
2702 { "ja", "America/Los_Angeles", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-08:00", "-8:00" },
2703 { "ja", "America/Los_Angeles", "2004-01-15T00:00:00Z", "z", "GMT-08:00", "America/Los_Angeles" },
2704 { "ja", "America/Los_Angeles", "2004-01-15T00:00:00Z", "V", "PST", "America/Los_Angeles" },
2705 { "ja", "America/Los_Angeles", "2004-01-15T00:00:00Z", "zzzz", "\\u30a2\\u30e1\\u30ea\\u30ab\\u592a\\u5e73\\u6d0b\\u6a19\\u6e96\\u6642", "America/Los_Angeles" },
2706 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "Z", "-0700", "-700" },
2707 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-07:00", "-7:00" },
2708 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "z", "GMT-07:00", "America/Los_Angeles" },
2709 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "V", "PDT", "America/Los_Angeles" },
2710 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "zzzz", "\\u30a2\\u30e1\\u30ea\\u30ab\\u592a\\u5e73\\u6d0b\\u590f\\u6642\\u9593", "America/Los_Angeles" },
2711 // icu ja.txt has exemplar city for this time zone
2712 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "v", "\\u30A2\\u30E1\\u30EA\\u30AB\\u5408\\u8846\\u56FD (\\u30ed\\u30b5\\u30f3\\u30bc\\u30eb\\u30b9)", "America/Los_Angeles" },
2713 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "vvvv", "\\u30A2\\u30E1\\u30EA\\u30AB\\u592A\\u5e73\\u6D0B\\u6642\\u9593", "America/Los_Angeles" },
2714 { "ja", "America/Los_Angeles", "2004-07-15T00:00:00Z", "VVVV", "\\u30A2\\u30E1\\u30EA\\u30AB\\u5408\\u8846\\u56FD (\\u30ed\\u30b5\\u30f3\\u30bc\\u30eb\\u30b9)", "America/Los_Angeles" },
2715
2716 { "ja", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2717 { "ja", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2718 { "ja", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2719 { "ja", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2720 { "ja", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2721 { "ja", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2722 { "ja", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2723 { "ja", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2724 // icu ja.txt does not have info for this time zone
2725 { "ja", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u30a2\\u30eb\\u30bc\\u30f3\\u30c1\\u30f3 (\\u30D6\\u30A8\\u30CE\\u30B9\\u30A2\\u30A4\\u30EC\\u30B9)", "America/Buenos_Aires" },
2726 { "ja", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u30a2\\u30eb\\u30bc\\u30f3\\u30c1\\u30f3\\u6642\\u9593", "America/Buenos_Aires" },
2727
2728 { "ja", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2729 { "ja", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2730 { "ja", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2731 { "ja", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2732 { "ja", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2733 { "ja", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2734 { "ja", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2735 { "ja", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2736 { "ja", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "\\u30a2\\u30eb\\u30bc\\u30f3\\u30c1\\u30f3 (\\u30D6\\u30A8\\u30CE\\u30B9\\u30A2\\u30A4\\u30EC\\u30B9)", "America/Buenos_Aires" },
2737 { "ja", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "\\u30a2\\u30eb\\u30bc\\u30f3\\u30c1\\u30f3\\u6642\\u9593", "America/Buenos_Aires" },
2738
2739 { "ja", "America/Havana", "2004-01-15T00:00:00Z", "Z", "-0500", "-5:00" },
2740 { "ja", "America/Havana", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-05:00", "-5:00" },
2741 { "ja", "America/Havana", "2004-01-15T00:00:00Z", "z", "GMT-05:00", "-5:00" },
2742 { "ja", "America/Havana", "2004-01-15T00:00:00Z", "zzzz", "GMT-05:00", "-5:00" },
2743 { "ja", "America/Havana", "2004-07-15T00:00:00Z", "Z", "-0400", "-4:00" },
2744 { "ja", "America/Havana", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-04:00", "-4:00" },
2745 { "ja", "America/Havana", "2004-07-15T00:00:00Z", "z", "GMT-04:00", "-4:00" },
2746 { "ja", "America/Havana", "2004-07-15T00:00:00Z", "zzzz", "GMT-04:00", "-4:00" },
2747 { "ja", "America/Havana", "2004-07-15T00:00:00Z", "v", "\\u30ad\\u30e5\\u30fc\\u30d0\\u6642\\u9593", "America/Havana" },
2748 { "ja", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "\\u30ad\\u30e5\\u30fc\\u30d0\\u6642\\u9593", "America/Havana" },
2749
2750 { "ja", "Australia/ACT", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2751 { "ja", "Australia/ACT", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2752 { "ja", "Australia/ACT", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2753 { "ja", "Australia/ACT", "2004-01-15T00:00:00Z", "zzzz", "GMT+11:00", "+11:00" },
2754 { "ja", "Australia/ACT", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2755 { "ja", "Australia/ACT", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2756 { "ja", "Australia/ACT", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2757 { "ja", "Australia/ACT", "2004-07-15T00:00:00Z", "zzzz", "GMT+10:00", "+10:00" },
2758 // icu ja.txt does not have info for this time zone
2759 { "ja", "Australia/ACT", "2004-07-15T00:00:00Z", "v", "\\u30aa\\u30fc\\u30b9\\u30c8\\u30e9\\u30ea\\u30a2 (\\u30b7\\u30c9\\u30cb\\u30fc)", "Australia/Sydney" },
2760 { "ja", "Australia/ACT", "2004-07-15T00:00:00Z", "vvvv", "\\u30aa\\u30fc\\u30b9\\u30c8\\u30e9\\u30ea\\u30a2 (\\u30b7\\u30c9\\u30cb\\u30fc)", "Australia/Sydney" },
2761
2762 { "ja", "Australia/Sydney", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2763 { "ja", "Australia/Sydney", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2764 { "ja", "Australia/Sydney", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2765 { "ja", "Australia/Sydney", "2004-01-15T00:00:00Z", "zzzz", "GMT+11:00", "+11:00" },
2766 { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2767 { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2768 { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2769 { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "zzzz", "GMT+10:00", "+10:00" },
2770 { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "v", "\\u30aa\\u30fc\\u30b9\\u30c8\\u30e9\\u30ea\\u30a2 (\\u30b7\\u30c9\\u30cb\\u30fc)", "Australia/Sydney" },
2771 { "ja", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "\\u30aa\\u30fc\\u30b9\\u30c8\\u30e9\\u30ea\\u30a2 (\\u30b7\\u30c9\\u30cb\\u30fc)", "Australia/Sydney" },
2772
2773 { "ja", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" },
2774 { "ja", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" },
2775 { "ja", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+00:00", "+0:00" },
2776 { "ja", "Europe/London", "2004-01-15T00:00:00Z", "V", "GMT", "+0:00" },
2777 { "ja", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "\\u30B0\\u30EA\\u30CB\\u30C3\\u30B8\\u6A19\\u6E96\\u6642", "+0:00" },
2778 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" },
2779 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" },
2780 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "z", "GMT+01:00", "+1:00" },
2781 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "V", "GMT+01:00", "+1:00" },
2782 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "zzzz", "GMT+01:00", "+1:00" },
2783 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "v", "\\u30a4\\u30ae\\u30ea\\u30b9\\u6642\\u9593", "Europe/London" },
2784 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "vvvv", "\\u30a4\\u30ae\\u30ea\\u30b9\\u6642\\u9593", "Europe/London" },
2785 { "ja", "Europe/London", "2004-07-15T00:00:00Z", "VVVV", "\\u30a4\\u30ae\\u30ea\\u30b9\\u6642\\u9593", "Europe/London" },
2786
2787 { "ja", "Etc/GMT+3", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2788 { "ja", "Etc/GMT+3", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2789 { "ja", "Etc/GMT+3", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2790 { "ja", "Etc/GMT+3", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2791 { "ja", "Etc/GMT+3", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2792 { "ja", "Etc/GMT+3", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2793 { "ja", "Etc/GMT+3", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2794 { "ja", "Etc/GMT+3", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2795 { "ja", "Etc/GMT+3", "2004-07-15T00:00:00Z", "v", "GMT-03:00", "-3:00" },
2796 { "ja", "Etc/GMT+3", "2004-07-15T00:00:00Z", "vvvv", "GMT-03:00", "-3:00" },
2797
2798 // JB#5150
2799 { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" },
2800 { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2801 { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "GMT+05:30", "+5:30" },
2802 { "ja", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "GMT+05:30", "+5:30" },
2803 { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" },
2804 { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2805 { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+05:30", "+05:30" },
2806 { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "GMT+05:30", "+5:30" },
2807 { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "\\u30A4\\u30F3\\u30C9\\u6642\\u9593", "Asia/Calcutta" },
2808 { "ja", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "\\u30A4\\u30F3\\u30C9\\u6642\\u9593", "Asia/Calcutta" },
2809
2810 // ==========
2811
2812 { "si", "America/Los_Angeles", "2004-01-15T00:00:00Z", "Z", "-0800", "-8:00" },
2813 { "si", "America/Los_Angeles", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-08:00", "-8:00" },
2814 { "si", "America/Los_Angeles", "2004-01-15T00:00:00Z", "z", "GMT-08:00", "-8:00" },
2815 { "si", "America/Los_Angeles", "2004-01-15T00:00:00Z", "zzzz", "GMT-08:00", "-8:00" },
2816 { "si", "America/Los_Angeles", "2004-07-15T00:00:00Z", "Z", "-0700", "-7:00" },
2817 { "si", "America/Los_Angeles", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-07:00", "-7:00" },
2818 { "si", "America/Los_Angeles", "2004-07-15T00:00:00Z", "z", "GMT-07:00", "-7:00" },
2819 { "si", "America/Los_Angeles", "2004-07-15T00:00:00Z", "zzzz", "GMT-07:00", "-7:00" },
2820 { "si", "America/Los_Angeles", "2004-07-15T00:00:00Z", "v", "US (Los Angeles)", "America/Los_Angeles" },
2821 { "si", "America/Los_Angeles", "2004-07-15T00:00:00Z", "vvvv", "US (Los Angeles)", "America/Los_Angeles" },
2822
2823 { "si", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2824 { "si", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2825 { "si", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2826 { "si", "America/Argentina/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2827 { "si", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2828 { "si", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2829 { "si", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2830 { "si", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2831 { "si", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "AR (Buenos Aires)", "America/Buenos_Aires" },
2832 { "si", "America/Argentina/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "AR (Buenos Aires)", "America/Buenos_Aires" },
2833
2834 { "si", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2835 { "si", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2836 { "si", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2837 { "si", "America/Buenos_Aires", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2838 { "si", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2839 { "si", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2840 { "si", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2841 { "si", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2842 { "si", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "v", "AR (Buenos Aires)", "America/Buenos_Aires" },
2843 { "si", "America/Buenos_Aires", "2004-07-15T00:00:00Z", "vvvv", "AR (Buenos Aires)", "America/Buenos_Aires" },
2844
2845 { "si", "America/Havana", "2004-01-15T00:00:00Z", "Z", "-0500", "-5:00" },
2846 { "si", "America/Havana", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-05:00", "-5:00" },
2847 { "si", "America/Havana", "2004-01-15T00:00:00Z", "z", "GMT-05:00", "-5:00" },
2848 { "si", "America/Havana", "2004-01-15T00:00:00Z", "zzzz", "GMT-05:00", "-5:00" },
2849 { "si", "America/Havana", "2004-07-15T00:00:00Z", "Z", "-0400", "-4:00" },
2850 { "si", "America/Havana", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-04:00", "-4:00" },
2851 { "si", "America/Havana", "2004-07-15T00:00:00Z", "z", "GMT-04:00", "-4:00" },
2852 { "si", "America/Havana", "2004-07-15T00:00:00Z", "zzzz", "GMT-04:00", "-4:00" },
2853 { "si", "America/Havana", "2004-07-15T00:00:00Z", "v", "CU", "America/Havana" },
2854 { "si", "America/Havana", "2004-07-15T00:00:00Z", "vvvv", "CU", "America/Havana" },
2855
2856 { "si", "Australia/ACT", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2857 { "si", "Australia/ACT", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2858 { "si", "Australia/ACT", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2859 { "si", "Australia/ACT", "2004-01-15T00:00:00Z", "zzzz", "GMT+11:00", "+11:00" },
2860 { "si", "Australia/ACT", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2861 { "si", "Australia/ACT", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2862 { "si", "Australia/ACT", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2863 { "si", "Australia/ACT", "2004-07-15T00:00:00Z", "zzzz", "GMT+10:00", "+10:00" },
2864 { "si", "Australia/ACT", "2004-07-15T00:00:00Z", "v", "AU (Sydney)", "Australia/Sydney" },
2865 { "si", "Australia/ACT", "2004-07-15T00:00:00Z", "vvvv", "AU (Sydney)", "Australia/Sydney" },
2866
2867 { "si", "Australia/Sydney", "2004-01-15T00:00:00Z", "Z", "+1100", "+11:00" },
2868 { "si", "Australia/Sydney", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+11:00", "+11:00" },
2869 { "si", "Australia/Sydney", "2004-01-15T00:00:00Z", "z", "GMT+11:00", "+11:00" },
2870 { "si", "Australia/Sydney", "2004-01-15T00:00:00Z", "zzzz", "GMT+11:00", "+11:00" },
2871 { "si", "Australia/Sydney", "2004-07-15T00:00:00Z", "Z", "+1000", "+10:00" },
2872 { "si", "Australia/Sydney", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+10:00", "+10:00" },
2873 { "si", "Australia/Sydney", "2004-07-15T00:00:00Z", "z", "GMT+10:00", "+10:00" },
2874 { "si", "Australia/Sydney", "2004-07-15T00:00:00Z", "zzzz", "GMT+10:00", "+10:00" },
2875 { "si", "Australia/Sydney", "2004-07-15T00:00:00Z", "v", "AU (Sydney)", "Australia/Sydney" },
2876 { "si", "Australia/Sydney", "2004-07-15T00:00:00Z", "vvvv", "AU (Sydney)", "Australia/Sydney" },
2877
2878 { "si", "Europe/London", "2004-01-15T00:00:00Z", "Z", "+0000", "+0:00" },
2879 { "si", "Europe/London", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+00:00", "+0:00" },
2880 { "si", "Europe/London", "2004-01-15T00:00:00Z", "z", "GMT+00:00", "+0:00" },
2881 { "si", "Europe/London", "2004-01-15T00:00:00Z", "zzzz", "GMT+00:00", "+0:00" },
2882 { "si", "Europe/London", "2004-07-15T00:00:00Z", "Z", "+0100", "+1:00" },
2883 { "si", "Europe/London", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+01:00", "+1:00" },
2884 { "si", "Europe/London", "2004-07-15T00:00:00Z", "z", "GMT+01:00", "+1:00" },
2885 { "si", "Europe/London", "2004-07-15T00:00:00Z", "zzzz", "GMT+01:00", "+1:00" },
2886 { "si", "Europe/London", "2004-07-15T00:00:00Z", "v", "GB", "Europe/London" },
2887 { "si", "Europe/London", "2004-07-15T00:00:00Z", "vvvv", "GB", "Europe/London" },
2888
2889 { "si", "Etc/GMT+3", "2004-01-15T00:00:00Z", "Z", "-0300", "-3:00" },
2890 { "si", "Etc/GMT+3", "2004-01-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2891 { "si", "Etc/GMT+3", "2004-01-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2892 { "si", "Etc/GMT+3", "2004-01-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2893 { "si", "Etc/GMT+3", "2004-07-15T00:00:00Z", "Z", "-0300", "-3:00" },
2894 { "si", "Etc/GMT+3", "2004-07-15T00:00:00Z", "ZZZZ", "GMT-03:00", "-3:00" },
2895 { "si", "Etc/GMT+3", "2004-07-15T00:00:00Z", "z", "GMT-03:00", "-3:00" },
2896 { "si", "Etc/GMT+3", "2004-07-15T00:00:00Z", "zzzz", "GMT-03:00", "-3:00" },
2897 { "si", "Etc/GMT+3", "2004-07-15T00:00:00Z", "v", "GMT-03:00", "-3:00" },
2898 { "si", "Etc/GMT+3", "2004-07-15T00:00:00Z", "vvvv", "GMT-03:00", "-3:00" },
2899
2900 // JB#5150
2901 { "si", "Asia/Calcutta", "2004-01-15T00:00:00Z", "Z", "+0530", "+5:30" },
2902 { "si", "Asia/Calcutta", "2004-01-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2903 { "si", "Asia/Calcutta", "2004-01-15T00:00:00Z", "z", "GMT+05:30", "+5:30" },
2904 { "si", "Asia/Calcutta", "2004-01-15T00:00:00Z", "zzzz", "GMT+05:30", "+5:30" },
2905 { "si", "Asia/Calcutta", "2004-07-15T00:00:00Z", "Z", "+0530", "+5:30" },
2906 { "si", "Asia/Calcutta", "2004-07-15T00:00:00Z", "ZZZZ", "GMT+05:30", "+5:30" },
2907 { "si", "Asia/Calcutta", "2004-07-15T00:00:00Z", "z", "GMT+05:30", "+05:30" },
2908 { "si", "Asia/Calcutta", "2004-07-15T00:00:00Z", "zzzz", "GMT+05:30", "+5:30" },
2909 { "si", "Asia/Calcutta", "2004-07-15T00:00:00Z", "v", "IN", "Asia/Calcutta" },
2910 { "si", "Asia/Calcutta", "2004-07-15T00:00:00Z", "vvvv", "IN", "Asia/Calcutta" },
2911 { NULL, NULL, NULL, NULL, NULL, NULL },
2912 };
2913
2914 UErrorCode status = U_ZERO_ERROR;
2915 Calendar *cal = GregorianCalendar::createInstance(status);
2916 ASSERT_OK(status);
2917 for (int i = 0; fallbackTests[i][0]; i++) {
2918 const char **testLine = fallbackTests[i];
2919 UnicodeString info[5];
2920 for ( int j = 0 ; j < 5 ; j++ ) {
2921 info[j] = UnicodeString(testLine[j], -1, US_INV);
2922 }
2923 info[4] = info[4].unescape();
2924 logln("%s;%s;%s;%s", testLine[0], testLine[1], testLine[2], testLine[3]);
2925
2926 TimeZone *tz = TimeZone::createTimeZone(info[1]);
2927
2928 if (strcmp(testLine[2], "2004-07-15T00:00:00Z") == 0) {
2929 cal->set(2004,6,15,0,0,0);
2930 } else {
2931 cal->set(2004,0,15,0,0,0);
73c04bcf 2932 }
46f4442e
A
2933
2934 SimpleDateFormat fmt(info[3], Locale(testLine[0]),status);
2935 ASSERT_OK(status);
2936 cal->adoptTimeZone(tz);
2937 UnicodeString result;
2938 FieldPosition pos(0);
2939 fmt.format(*cal,result,pos);
2940 if (result != info[4]) {
2941 errln(info[0] + ";" + info[1] + ";" + info[2] + ";" + info[3] + " expected: '" +
2942 info[4] + "' but got: '" + result + "'");
73c04bcf
A
2943 }
2944 }
46f4442e
A
2945 delete cal;
2946}
2947
2948/*
2949void DateFormatTest::TestRelativeError(void)
2950{
2951 UErrorCode status;
2952 Locale en("en");
2953
2954 DateFormat *en_reltime_reldate = DateFormat::createDateTimeInstance(DateFormat::kFullRelative,DateFormat::kFullRelative,en);
2955 if(en_reltime_reldate == NULL) {
2956 logln("PASS: rel date/rel time failed");
2957 } else {
2958 errln("FAIL: rel date/rel time created, should have failed.");
2959 delete en_reltime_reldate;
73c04bcf 2960 }
73c04bcf
A
2961}
2962
46f4442e 2963void DateFormatTest::TestRelativeOther(void)
73c04bcf 2964{
46f4442e 2965 logln("Nothing in this test. When we get more data from CLDR, put in some tests of -2, +2, etc. ");
73c04bcf 2966}
46f4442e
A
2967*/
2968
7393aa2f
A
2969void DateFormatTest::TestNumberAsStringParsing()
2970{
2971 UErrorCode status = U_ZERO_ERROR;
2972 UnicodeString dateString("2009 7 2 08:14:16");
2973 UnicodeString datePattern("y MMMM d HH:mm:ss");
2974 SimpleDateFormat *formatter = new SimpleDateFormat(datePattern, Locale(""), status);
2975 UDate date1 = 0;
2976
2977 formatter->setLenient(FALSE);
2978 date1 = formatter->parse(dateString, status);
2979
2980 if (U_FAILURE(status)) {
2981 errln("FAIL: Could not parse \"2009 7 2 08:14:16\" with pattern \"y MMMM d HH:mm:ss\"");
2982 } else {
2983 UnicodeString formatted;
2984
2985 formatter->format(date1, formatted);
2986
2987 if (formatted != dateString) {
2988 errln("FAIL: parsed string did not match input.");
2989 }
2990 }
2991
2992 delete formatter;
2993}
2994
46f4442e 2995
73c04bcf 2996
b75a7d8f
A
2997#endif /* #if !UCONFIG_NO_FORMATTING */
2998
2999//eof