/libcore/ojluni/src/test/java/time/test/java/time/temporal/ |
H A D | TestChronoUnit.java | 89 {date(1939, SEPTEMBER, 2), date(1939, SEPTEMBER, 1), 0}, 90 {date(1939, SEPTEMBER, 2), date(1939, SEPTEMBER, 2), 0}, 91 {date(1939, SEPTEMBER, 2), date(1939, SEPTEMBER, 3), 0}, 93 {date(1939, SEPTEMBER, 2), date(1940, SEPTEMBER, 1), 0}, 94 {date(1939, SEPTEMBER, 2), date(194 330 private static LocalDate date(int year, Month month, int dom) { method in class:TestChronoUnit [all...] |
/libcore/luni/src/test/java/tests/java/sql/ |
H A D | SqlDateTest.java | 29 for (String date : dates) { 30 Date.valueOf(date); 43 for (String date : invalidDates) { 45 Date.valueOf(date);
|
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/ |
H A D | TCKIsoChronology.java | 151 assertEquals(IsoChronology.INSTANCE.date(new TemporalAccessor() { 181 IsoChronology.INSTANCE.date(null); 358 LocalDate date = IsoChronology.INSTANCE.resolveDate(fieldValues, style); 359 assertEquals(date, null); 377 {2012, 1, -365, date(2010, 12, 31), false, false}, 378 {2012, 1, -364, date(2011, 1, 1), false, false}, 379 {2012, 1, -31, date(2011, 11, 30), false, false}, 380 {2012, 1, -30, date(2011, 12, 1), false, false}, 381 {2012, 1, -12, date(2011, 12, 19), false, false}, 382 {2012, 1, 1, date(201 679 private static LocalDate date(int y, int m, int d) { method in class:TCKIsoChronology [all...] |
H A D | TCKThaiBuddhistChronology.java | 168 {ThaiBuddhistChronology.INSTANCE.date(1 + YDIFF, 1, 1), LocalDate.of(1, 1, 1)}, 169 {ThaiBuddhistChronology.INSTANCE.date(1 + YDIFF, 1, 2), LocalDate.of(1, 1, 2)}, 170 {ThaiBuddhistChronology.INSTANCE.date(1 + YDIFF, 1, 3), LocalDate.of(1, 1, 3)}, 172 {ThaiBuddhistChronology.INSTANCE.date(2 + YDIFF, 1, 1), LocalDate.of(2, 1, 1)}, 173 {ThaiBuddhistChronology.INSTANCE.date(3 + YDIFF, 1, 1), LocalDate.of(3, 1, 1)}, 174 {ThaiBuddhistChronology.INSTANCE.date(3 + YDIFF, 12, 6), LocalDate.of(3, 12, 6)}, 175 {ThaiBuddhistChronology.INSTANCE.date(4 + YDIFF, 1, 1), LocalDate.of(4, 1, 1)}, 176 {ThaiBuddhistChronology.INSTANCE.date(4 + YDIFF, 7, 3), LocalDate.of(4, 7, 3)}, 177 {ThaiBuddhistChronology.INSTANCE.date(4 + YDIFF, 7, 4), LocalDate.of(4, 7, 4)}, 178 {ThaiBuddhistChronology.INSTANCE.date( 930 private static ThaiBuddhistDate date(int y, int m, int d) { method in class:TCKThaiBuddhistChronology [all...] |
H A D | TCKMinguoChronology.java | 131 {MinguoChronology.INSTANCE.date(1, 1, 1), LocalDate.of(1 + YDIFF, 1, 1)}, 132 {MinguoChronology.INSTANCE.date(1, 1, 2), LocalDate.of(1 + YDIFF, 1, 2)}, 133 {MinguoChronology.INSTANCE.date(1, 1, 3), LocalDate.of(1 + YDIFF, 1, 3)}, 135 {MinguoChronology.INSTANCE.date(2, 1, 1), LocalDate.of(2 + YDIFF, 1, 1)}, 136 {MinguoChronology.INSTANCE.date(3, 1, 1), LocalDate.of(3 + YDIFF, 1, 1)}, 137 {MinguoChronology.INSTANCE.date(3, 12, 6), LocalDate.of(3 + YDIFF, 12, 6)}, 138 {MinguoChronology.INSTANCE.date(4, 1, 1), LocalDate.of(4 + YDIFF, 1, 1)}, 139 {MinguoChronology.INSTANCE.date(4, 7, 3), LocalDate.of(4 + YDIFF, 7, 3)}, 140 {MinguoChronology.INSTANCE.date(4, 7, 4), LocalDate.of(4 + YDIFF, 7, 4)}, 141 {MinguoChronology.INSTANCE.date( 954 private static MinguoDate date(int y, int m, int d) { method in class:TCKMinguoChronology [all...] |
H A D | TCKJapaneseChronology.java | 193 JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.date(era, yoe, moy, dom); 217 assertEquals(IsoChronology.INSTANCE.date(test), iso); 218 assertEquals(JapaneseChronology.INSTANCE.date(iso), test); 261 JapaneseDate dateByChronoFactory = JapaneseChronology.INSTANCE.date(y, moy, dom); 285 assertEquals(IsoChronology.INSTANCE.date(test), iso); 286 assertEquals(JapaneseChronology.INSTANCE.date(iso), test); 359 JapaneseChronology.INSTANCE.date(year, month, dom); 427 // Bad Era for Chronology.date(era,...) and Chronology.prolepticYear(Era,...) 439 ChronoLocalDate date = JapaneseChronology.INSTANCE.date(er 1175 private static JapaneseDate date(int y, int m, int d) { method in class:TCKJapaneseChronology [all...] |
H A D | TCKChronoLocalDate.java | 116 ChronoLocalDate date = chrono.date(refDate); 119 ChronoLocalDate date2 = chrono2.date(refDate); 123 date.with(adjuster); 130 ChronoLocalDate result = date.with(adjuster); 131 assertEquals(result, date2, "WithAdjuster failed to replace date"); 139 ChronoLocalDate date = chrono.date(refDate); 142 ChronoLocalDate date2 = chrono2.date(refDate); 146 date [all...] |
H A D | TCKHijrahChronology.java | 147 // This is a negative test to verify if the API throws exception if an invalid date is provided 150 HijrahChronology.INSTANCE.date(year, month, dom); 162 // Bad Era for Chronology.date(era,...) and Chronology.prolepticYear(Era,...) 174 ChronoLocalDate date = HijrahChronology.INSTANCE.date(era, 1, 1, 1); 175 fail("HijrahChronology.date did not throw ClassCastException for Era: " + era); 219 HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style); 220 assertEquals(date, null); 230 HijrahDate date = HijrahChronology.INSTANCE.resolveDate(fieldValues, style); 231 assertEquals(date, nul 532 private static HijrahDate date(int y, int m, int d) { method in class:TCKHijrahChronology [all...] |
/libcore/luni/src/test/java/libcore/java/time/chrono/ |
H A D | JapaneseChronologyTest.java | 80 JapaneseDate date = JapaneseDate.now(); 81 // all date based fields, except for the aligned week ones are supported. 82 assertEquals(false, date.isSupported(ChronoField.ALIGNED_DAY_OF_WEEK_IN_MONTH)); 83 assertEquals(false, date.isSupported(ChronoField.ALIGNED_DAY_OF_WEEK_IN_YEAR)); 84 assertEquals(false, date.isSupported(ChronoField.ALIGNED_WEEK_OF_MONTH)); 85 assertEquals(false, date.isSupported(ChronoField.ALIGNED_WEEK_OF_YEAR)); 86 assertEquals(false, date.isSupported(ChronoField.AMPM_OF_DAY)); 87 assertEquals(false, date.isSupported(ChronoField.CLOCK_HOUR_OF_AMPM)); 88 assertEquals(false, date.isSupported(ChronoField.CLOCK_HOUR_OF_DAY)); 89 assertEquals(true, date [all...] |
H A D | HijrahChronologyTest.java | 42 HijrahDate date = HijrahDate.of(1300, 2, 5); 43 assertEquals(1300, date.getLong(ChronoField.YEAR_OF_ERA)); 44 assertEquals(1300, date.getLong(ChronoField.YEAR)); 45 assertEquals(2, date.getLong(ChronoField.MONTH_OF_YEAR)); 47 assertEquals(1300 * 12 + 2 - 1, date.getLong(ChronoField.PROLEPTIC_MONTH)); 48 assertEquals(5, date.getLong(ChronoField.DAY_OF_MONTH)); 50 assertEquals(30 + 5, date.getLong(ChronoField.DAY_OF_YEAR)); 51 assertEquals(date.toEpochDay(), date.getLong(ChronoField.EPOCH_DAY));
|
H A D | MinguoChronologyTest.java | 91 for (MinguoDate date : dates) { 92 // only these three ChronoFields and YEAR_OF_ERA (below) have date-dependent ranges. 93 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_MONTH), 94 date.range(ChronoField.DAY_OF_MONTH)); 95 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_YEAR), 96 date.range(ChronoField.DAY_OF_YEAR)); 97 assertEquals(LocalDate.from(date).range(ChronoField.ALIGNED_WEEK_OF_MONTH), 98 date.range(ChronoField.ALIGNED_WEEK_OF_MONTH)); 113 MinguoDate date = MinguoDate.of(10, 2, 5); 114 assertEquals(10, date [all...] |
H A D | ThaiBuddhistChronologyTest.java | 93 for (ThaiBuddhistDate date : dates) { 94 // only these three ChronoFields and YEAR_OF_ERA (below) have date-dependent ranges. 95 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_MONTH), 96 date.range(ChronoField.DAY_OF_MONTH)); 97 assertEquals(LocalDate.from(date).range(ChronoField.DAY_OF_YEAR), 98 date.range(ChronoField.DAY_OF_YEAR)); 99 assertEquals(LocalDate.from(date).range(ChronoField.ALIGNED_WEEK_OF_MONTH), 100 date.range(ChronoField.ALIGNED_WEEK_OF_MONTH)); 115 ThaiBuddhistDate date = ThaiBuddhistDate.of(10, 2, 5); 116 assertEquals(10, date [all...] |
/libcore/ojluni/src/main/java/sun/util/calendar/ |
H A D | ImmutableGregorianDate.java | 32 private final BaseCalendar.Date date; field in class:ImmutableGregorianDate 34 ImmutableGregorianDate(BaseCalendar.Date date) { argument 35 if (date == null) { 38 this.date = date; 42 return date.getEra(); 50 return date.getYear(); 62 return date.isLeapYear(); 70 return date.getMonth(); 82 return date 85 setDayOfMonth(int date) argument 197 isSameDate(CalendarDate date) argument [all...] |
H A D | AbstractCalendar.java | 39 * have the common date numbering, starting from midnight the onset of 40 * Monday, January 1, 1 (Gregorian). It is called a <I>fixed date</I> 41 * in this class. January 1, 1 (Gregorian) is fixed date 1. (See 85 public void setEra(CalendarDate date, String eraName) { argument 92 date.setEra(e); 112 CalendarDate date = newCalendarDate(zone); 113 return getCalendarDate(millis, date); 116 public CalendarDate getCalendarDate(long millis, CalendarDate date) { argument 120 long days = 0; // fixed date 122 // adjust to local time if `date' ha 171 getTime(CalendarDate date) argument 203 getTimeOfDay(CalendarDate date) argument 213 getTimeOfDayValue(CalendarDate date) argument 258 isLeapYear(CalendarDate date) argument 260 getNthDayOfWeek(int nth, int dayOfWeek, CalendarDate date) argument 325 getFixedDate(CalendarDate date) argument 337 getCalendarDateFromFixedDate(CalendarDate date, long fixedDate) argument 340 validateTime(CalendarDate date) argument 362 normalizeTime(CalendarDate date) argument [all...] |
H A D | BaseCalendar.java | 162 // Cache for the fixed date of January 1 and year length of the 192 public boolean validate(CalendarDate date) { argument 193 Date bdate = (Date) date; 210 if (!validateTime(date)) { 218 public boolean normalize(CalendarDate date) { argument 219 if (date.isNormalized()) { 223 Date bdate = (Date) date; 226 // If the date has a time zone, then we need to recalculate 229 getTime(date); 266 date 273 normalizeMonth(CalendarDate date) argument 303 getYearLength(CalendarDate date) argument 307 getYearLengthInMonths(CalendarDate date) argument 322 getMonthLength(CalendarDate date) argument 340 getDayOfYear(CalendarDate date) argument 353 getFixedDate(CalendarDate date) argument 419 getCalendarDateFromFixedDate(CalendarDate date, long fixedDate) argument 472 getDayOfWeek(CalendarDate date) argument 531 isLeapYear(CalendarDate date) argument [all...] |
H A D | CalendarSystem.java | 40 * programming interface to deal with calendar date and time. 53 * because, for example, a Chinese calendar date can't be understood 196 public abstract CalendarDate getCalendarDate(long millis, CalendarDate date); argument 218 * @param date the <code>CalendarDate</code> from which the time 222 public abstract long getTime(CalendarDate date); argument 226 * <code>date</code>. This method does not perform the 231 public abstract int getYearLength(CalendarDate date); argument 239 public abstract int getYearLengthInMonths(CalendarDate date); argument 243 * date. This method does not perform the normalization with the 244 * specified calendar date 252 getMonthLength(CalendarDate date) argument 291 setEra(CalendarDate date, String eraName) argument 318 getNthDayOfWeek(int nth, int dayOfWeek, CalendarDate date) argument 321 setTimeOfDay(CalendarDate date, int timeOfDay) argument 334 validate(CalendarDate date) argument 348 normalize(CalendarDate date) argument [all...] |
/libcore/ojluni/src/test/java/time/tck/java/time/temporal/ |
H A D | TCKTemporalAdjusters.java | 92 TemporalAdjuster test = TemporalAdjusters.ofDateAdjuster(date -> date.plusDays(2)); 114 LocalDate date = date(2007, month, i); 115 LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfMonth().adjustInto(date); 127 LocalDate date = date(2008, month, i); 128 LocalDate test = (LocalDate) TemporalAdjusters.firstDayOfMonth().adjustInto(date); 148 LocalDate date = date(200 608 private LocalDate date(int year, Month month, int day) { method in class:TCKTemporalAdjusters 612 private LocalDate date(int year, int month, int day) { method in class:TCKTemporalAdjusters [all...] |
H A D | TCKWeekFields.java | 125 LocalDate date = LocalDate.of(2000, 1, 10); // Known to be ISO Monday 126 assertEquals(date.get(WeekFields.ISO.dayOfWeek()), 1); 127 assertEquals(date.get(WeekFields.of(DayOfWeek.MONDAY, 1).dayOfWeek()), 1); 128 assertEquals(date.get(WeekFields.of(DayOfWeek.MONDAY, 7).dayOfWeek()), 1); 129 assertEquals(date.get(WeekFields.SUNDAY_START.dayOfWeek()), 2); 130 assertEquals(date.get(WeekFields.of(DayOfWeek.SUNDAY, 1).dayOfWeek()), 2); 131 assertEquals(date.get(WeekFields.of(DayOfWeek.SUNDAY, 7).dayOfWeek()), 2); 132 assertEquals(date.get(WeekFields.of(DayOfWeek.SATURDAY, 1).dayOfWeek()), 3); 133 assertEquals(date.get(WeekFields.of(DayOfWeek.FRIDAY, 1).dayOfWeek()), 4); 134 assertEquals(date 747 test_weekBasedYears(WeekFields weekDef, int weekBasedYear, int weekOfWeekBasedYear, int dayOfWeek, LocalDate date) argument 782 test_WOWBY(LocalDate date, DayOfWeek dow, int week, int wby) argument [all...] |
/libcore/ojluni/src/test/java/time/test/java/time/chrono/ |
H A D | TestChronoLocalDate.java | 77 * Test chrono local date. 86 ChronoLocalDate date = LocalDate.of(2013, 1, 1); 89 dates.add(date.minus(10, ChronoUnit.YEARS)); 90 dates.add(date.minus(1, ChronoUnit.YEARS)); 91 dates.add(date.minus(1, ChronoUnit.MONTHS)); 92 dates.add(date.minus(1, ChronoUnit.WEEKS)); 93 dates.add(date.minus(1, ChronoUnit.DAYS)); 94 dates.add(date); 95 dates.add(date.plus(1, ChronoUnit.DAYS)); 96 dates.add(date 173 processOK(D date) argument [all...] |
/libcore/benchmarks/src/benchmarks/regression/ |
H A D | DateToStringBenchmark.java | 27 Date date; field in class:DateToStringBenchmark 33 date = new Date(0); 35 calendar.setTime(date); 41 date.toString(); 47 new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy").format(date); 53 ((SimpleDateFormat) format.clone()).format(date);
|
/libcore/ojluni/src/test/java/time/tck/java/time/ |
H A D | TestIsoChronology.java | 131 {IsoChronology.INSTANCE.date(1, 7, 8), LocalDate.of(1, 7, 8)}, 132 {IsoChronology.INSTANCE.date(1, 7, 20), LocalDate.of(1, 7, 20)}, 133 {IsoChronology.INSTANCE.date(1, 7, 21), LocalDate.of(1, 7, 21)}, 135 {IsoChronology.INSTANCE.date(2, 7, 8), LocalDate.of(2, 7, 8)}, 136 {IsoChronology.INSTANCE.date(3, 6, 27), LocalDate.of(3, 6, 27)}, 137 {IsoChronology.INSTANCE.date(3, 5, 23), LocalDate.of(3, 5, 23)}, 138 {IsoChronology.INSTANCE.date(4, 6, 16), LocalDate.of(4, 6, 16)}, 139 {IsoChronology.INSTANCE.date(4, 7, 3), LocalDate.of(4, 7, 3)}, 140 {IsoChronology.INSTANCE.date(4, 7, 4), LocalDate.of(4, 7, 4)}, 141 {IsoChronology.INSTANCE.date( [all...] |
/libcore/ojluni/src/main/java/sun/security/x509/ |
H A D | InvalidityDateExtension.java | 38 * The invalidity date is a non-critical CRL entry extension that 39 * provides the date on which it is known or suspected that the private 41 * This date may be earlier than the revocation date in the CRL entry, 42 * which is the date at which the CA processed the revocation. When a 44 * date may precede the date of issue of earlier CRLs, but the 45 * revocation date SHOULD NOT precede the date of issue of earlier CRLs. 67 public static final String DATE = "date"; 69 private Date date; field in class:InvalidityDateExtension 87 InvalidityDateExtension(Date date) argument 97 InvalidityDateExtension(boolean critical, Date date) argument [all...] |
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ |
H A D | Support_SimpleDateFormat.java | 53 Date date = cal.getTime(); 75 t_FormatWithField(0, format, date, null, Field.ERA, 0, 2); 76 t_FormatWithField(1, format, date, null, Field.YEAR, 6, 10); 77 t_FormatWithField(2, format, date, null, Field.MONTH, 19, 20); 78 t_FormatWithField(3, format, date, null, Field.DAY_OF_MONTH, 38, 40); 79 t_FormatWithField(4, format, date, null, Field.HOUR_OF_DAY1, 48, 50); 80 t_FormatWithField(5, format, date, null, Field.HOUR_OF_DAY0, 58, 60); 81 t_FormatWithField(6, format, date, null, Field.HOUR1, 68, 69); 82 t_FormatWithField(7, format, date, null, Field.MINUTE, 77, 79); 83 t_FormatWithField(8, format, date, nul [all...] |
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/serial/ |
H A D | TCKChronoLocalDateSerialization.java | 110 public void test_ChronoSerialization(ChronoLocalDate date, int dateType) throws Exception { argument 111 assertSerializable(date); 118 private void test_serialization_format(ChronoLocalDate date, int dateType) throws Exception { argument 122 dos.writeInt(date.get(YEAR)); 123 dos.writeByte(date.get(MONTH_OF_YEAR)); 124 dos.writeByte(date.get(DAY_OF_MONTH)); 127 assertSerializedBySer(date, bytes); 136 HijrahDate date = HijrahDate.of(1433, 10, 29); 155 dos.writeInt(date.get(YEAR)); 156 dos.writeByte(date [all...] |
/libcore/ojluni/src/test/java/time/test/java/time/format/ |
H A D | TestReducedPrinter.java | 216 MinguoDate date = MinguoDate.of(109, 6, 30); 217 assertEquals(f.format(date), "09"); 218 date = MinguoDate.of(110, 6, 30); 219 assertEquals(f.format(date), "10"); 220 date = MinguoDate.of(199, 6, 30); 221 assertEquals(f.format(date), "99"); 222 date = MinguoDate.of(200, 6, 30); 223 assertEquals(f.format(date), "00"); 224 date = MinguoDate.of(209, 6, 30); 225 assertEquals(f.format(date), "0 [all...] |