1 // Copyright (C) 2016 and later: Unicode, Inc. and others.
2 // License & terms of use: http://www.unicode.org/copyright.html
3 // Copyright (c) 2007-2015 International Business Machines
4 // Corporation and others. All Rights Reserved.
5 format:table(nofallback) {
7 Description { "These are the data driven format tests" }
8 LongDescription { "Data for data driven format tests." }
13 Description { "Test data for format and parse :" }
16 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
18 Type { "date_format" }
24 Headers { "locale", "zone", "spec", "date", "str"}
25 // locale: locale including calendar type
26 // zone: time zone name, or "" to not explicitly set zone
27 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
28 // date: either 'MILLIS=####' where #### is millis,
29 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
30 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
31 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
32 // and any other fields present will be set explicitly.
33 // str: the expected unicode string
36 "en_US@calendar=gregorian",
38 "DATE=SHORT,TIME=SHORT",
39 "ERA=1,YEAR=2007,MONTH=AUGUST,DATE=8,HOUR_OF_DAY=18,MINUTE=54,SECOND=0",
46 "ERA=1,YEAR=98,MONTH=0,DATE=24",
50 //民國前2年1月24日 -> 1910-1-24
54 "ERA=0,YEAR=2,MONTH=0,DATE=24",
61 Description { "relative format :" }
65 Type { "date_format" }
68 Headers { "locale", "zone", "spec", "date", "str"}
71 "en_US@calendar=gregorian",
73 "DATE=RELATIVE_SHORT",
74 "RELATIVE_ADD:DATE=1", // one day from now
78 "en_US@calendar=gregorian",
80 "DATE=RELATIVE_SHORT",
81 "RELATIVE_MILLIS=0", // today
85 "en_US@calendar=gregorian",
87 "DATE=RELATIVE_SHORT",
88 "RELATIVE_ADD:DATE=-1", // one day before now
91 // date only, out of relative range
93 "en_US@calendar=gregorian",
96 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
97 "Monday, October 8, 2012"
101 "en_US@calendar=gregorian",
104 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
108 "en_US@calendar=gregorian",
111 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
114 // normal formats, combined using 'at'
116 "en_US@calendar=gregorian",
118 "DATE=RELATIVE_FULL,TIME=LONG",
119 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
120 "Monday, October 8, 2012 at 11:59:00 PM GMT"
122 // normal formats, combined using 'at'
124 "en_US@calendar=gregorian",
126 "DATE=RELATIVE_MEDIUM,TIME=SHORT",
127 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
128 "Oct 8, 2012 at 11:59 PM"
130 // formats with relative day, combined using 'at'
132 "en_US@calendar=gregorian",
134 "DATE=RELATIVE_FULL,TIME=LONG",
135 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
136 "yesterday at 5:00:00 PM GMT"
138 // formats with relative day, combined using 'at'
140 "en_US@calendar=gregorian",
142 "DATE=RELATIVE_MEDIUM,TIME=SHORT",
143 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
144 "yesterday at 5:00 PM"
146 // normal formats that have quoted literals, combined
148 "pt@calendar=gregorian",
150 "DATE=RELATIVE_FULL,TIME=LONG",
151 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
152 "segunda-feira, 8 de outubro de 2012 23:59:00 GMT"
154 // vi combined formats have time first
156 "vi@calendar=gregorian",
158 "DATE=RELATIVE_LONG,TIME=MEDIUM",
159 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
160 "23:59:00 ngày 8 tháng 10, 2012"
163 "vi@calendar=gregorian",
165 "DATE=RELATIVE_LONG,TIME=MEDIUM",
166 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
169 // el combines formats using hyphen
171 "el@calendar=gregorian",
173 "DATE=RELATIVE_LONG,TIME=MEDIUM",
174 "ERA=1,YEAR=2012,MONTH=OCTOBER,DATE=8,HOUR_OF_DAY=23,MINUTE=59,SECOND=0",
175 "8 Οκτωβρίου 2012 - 11:59:00 μμ"
178 "el@calendar=gregorian",
180 "DATE=RELATIVE_LONG,TIME=MEDIUM",
181 "RELATIVE_ADD:DATE=-1,HOUR_OF_DAY=17,MINUTE=0,SECOND=0", // one day before now at specified time
186 "mt_MT@calendar=gregorian",
188 "DATE=RELATIVE_SHORT",
189 "RELATIVE_ADD:DATE=1", // one day from now
193 "mt_MT@calendar=gregorian",
195 "DATE=RELATIVE_SHORT",
196 "RELATIVE_MILLIS=0", // today
200 "mt_MT@calendar=gregorian",
202 "DATE=RELATIVE_SHORT",
203 "RELATIVE_ADD:DATE=-1", // one day before now
209 "DATE=RELATIVE_SHORT",
210 "RELATIVE_ADD:DATE=-2", // 2 days ago
217 Description { "Test data for multiple year lengths, y yy yyy yyyy yyyyy:" }
220 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
222 Type { "date_format" }
224 // These are not round trippable, so do not parse.
226 // Type { "date_parse" }
229 Headers { "locale", "zone", "spec", "date", "str"}
230 // locale: locale including calendar type
231 // zone: time zone name, or "" to not explicitly set zone
232 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
233 // date: either 'MILLIS=####' where #### is millis,
234 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
235 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
236 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
237 // and any other fields present will be set explicitly.
238 // str: the expected unicode string
241 //Year y yy yyy yyyy yyyyy
244 //AD 1 1 01 001 0001 00001
246 "en_US@calendar=gregorian",
253 "en_US@calendar=gregorian",
260 "en_US@calendar=gregorian",
267 "en_US@calendar=gregorian",
274 "en_US@calendar=gregorian",
280 //AD 12 12 12 012 0012 00012
282 "en_US@calendar=gregorian",
289 "en_US@calendar=gregorian",
296 "en_US@calendar=gregorian",
303 "en_US@calendar=gregorian",
310 "en_US@calendar=gregorian",
316 //AD 123 123 23 123 0123 00123
318 "en_US@calendar=gregorian",
325 "en_US@calendar=gregorian",
332 "en_US@calendar=gregorian",
339 "en_US@calendar=gregorian",
346 "en_US@calendar=gregorian",
352 //AD 1234 1234 34 1234 1234 01234
354 "en_US@calendar=gregorian",
361 "en_US@calendar=gregorian",
368 "en_US@calendar=gregorian",
375 "en_US@calendar=gregorian",
382 "en_US@calendar=gregorian",
388 //AD 12345 12345 45 12345 12345 12345
390 "en_US@calendar=gregorian",
397 "en_US@calendar=gregorian",
404 "en_US@calendar=gregorian",
411 "en_US@calendar=gregorian",
418 "en_US@calendar=gregorian",
426 TestConsistentPivot {
428 Description { "Test consistent pivot (parse/format) for multiple year lengths, y yy yyy yyyy yyyyy:" }
431 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
433 Type { "date_format" }
436 Type { "date_parse" }
439 Headers { "locale", "zone", "spec", "date", "str"}
440 // locale: locale including calendar type
441 // zone: time zone name, or "" to not explicitly set zone
442 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
443 // date: either 'MILLIS=####' where #### is millis,
444 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
445 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
446 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
447 // and any other fields present will be set explicitly.
448 // str: the expected unicode string
451 //Year y yy yyy yyyy yyyyy
454 //AD 1 1 01 001 0001 00001
456 "en_US@calendar=gregorian",
463 "en_US@calendar=gregorian",
470 "en_US@calendar=gregorian",
477 "en_US@calendar=gregorian",
484 "en_US@calendar=gregorian",
493 "en_US@calendar=japanese",
500 "en_US@calendar=japanese",
507 "en_US@calendar=japanese",
514 "en_US@calendar=japanese",
521 "en_US@calendar=japanese",
532 Description { "Test Hebrew calendar:" }
535 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
537 Type { "date_format" }
540 Headers { "locale", "zone", "spec", "date", "str"}
541 // locale: locale including calendar type
542 // zone: time zone name, or "" to not explicitly set zone
543 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
544 // date: either 'MILLIS=####' where #### is millis,
545 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
546 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
547 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
548 // and any other fields present will be set explicitly.
549 // str: the expected unicode string
553 "en_US@calendar=hebrew",
555 "DATE=FULL,TIME=FULL",
556 "MILLIS=3076424179200000",
557 "Friday, 3 Heshvan 103217 at 12:00:00 AM GMT-08:00"
563 Description { "Additional date parse tests (may not
564 round/trip to format.)" }
567 // options: 'format', or 'parse'. One can be omitted if this is a 1 way test.
569 Type { "date_parse" }
572 Headers { "locale", "zone", "spec", "date", "str"}
573 // locale: locale including calendar type
574 // zone: time zone name, or "" to not explicitly set zone
575 // spec: either 'PATTERN=y mm h' etc, or 'DATE=SHORT,TIME=LONG'
576 // date: either 'MILLIS=####' where #### is millis,
577 // or a calendar spec ERA=0,YEAR=1, etc.. applied to the calendar type specified by the locale
578 // or RELATIVE_MILLIS=### where ### is a signed value which is added to the current millis
579 // or RELATIVE_ADD:DATE=1 which means that the field "DATE" will be added by +1 relative to current time,
580 // and any other fields present will be set explicitly.
581 // str: the expected unicode string
585 "en_US@calendar=gregorian",
587 "PATTERN=YYYYHHmmssEEEww",
588 "YEAR=1999,HOUR_OF_DAY=4,MINUTE=5,SECOND=6,DAY_OF_WEEK=2,WEEK_OF_YEAR=4",