/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/ |
H A D | CalendarTest.java | 41 Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("EST")); 43 cal.clear(); 44 cal.set(Calendar.YEAR, 2002); 45 assertTrue("Incorrect result 0: " + cal.getTime().getTime(), cal 48 cal.clear(); 49 cal.set(Calendar.YEAR, 2002); 50 cal.set(Calendar.MONTH, Calendar.MARCH); 51 assertTrue("Incorrect result 0a: " + cal.getTime(), cal [all...] |
H A D | DateTest.java | 55 Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 22); 56 assertTrue("Wrong time zone", date.equals(cal.getTime())); 304 GregorianCalendar cal = new GregorianCalendar(); 305 cal.setTime(d); 306 assertEquals("Parsed incorrect month", 9, cal.get(Calendar.MONTH)); 307 assertEquals("Parsed incorrect year", 1998, cal.get(Calendar.YEAR)); 308 assertEquals("Parsed incorrect date", 13, cal.get(Calendar.DATE)); 317 cal.setTimeZone(TimeZone.getTimeZone("GMT")); 318 cal.clear(); 319 cal [all...] |
H A D | GregorianCalendarTest.java | 560 GregorianCalendar cal = new GregorianCalendar(); 563 cal.roll(Calendar.ZONE_OFFSET, true); 570 cal.roll(Calendar.DST_OFFSET, true); 577 cal.set(2004, Calendar.DECEMBER, 31, 5, 0, 0); 578 cal.roll(Calendar.WEEK_OF_YEAR, true); 579 assertEquals("Wrong year: " + cal.getTime(), 2004, cal 581 assertEquals("Wrong month: " + cal.getTime(), Calendar.JANUARY, cal 583 assertEquals("Wrong date: " + cal [all...] |
H A D | SimpleTimeZoneTest.java | 802 Calendar cal = Calendar.getInstance(); 803 cal.set(1998, Calendar.NOVEMBER, 11, 0, 0); 806 assertTrue("Incorrect offset returned", st1.getOffset(cal.getTimeInMillis()) == 810 cal.set(1998, Calendar.JUNE, 11, 0, 0); 812 .getOffset(cal.getTimeInMillis())); 818 cal.set(2099, 01, 1, 0, 0); 820 assertEquals(fourHours, st1.getOffset(cal.getTimeInMillis()));
|
/libcore/luni/src/test/java/libcore/java/util/ |
H A D | OldFormatterTest.java | 56 Calendar cal = Calendar.getInstance(); 59 cal.set(2008, Calendar.SEPTEMBER, 23, 18, 30); 81 fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal, cal, cal); 82 fNoL.format("%tA %tB %td %tT", cal, cal, cal, cal); [all...] |
H A D | GregorianCalendarTest.java | 212 GregorianCalendar cal = new GregorianCalendar(); 215 cal.setMinimalDaysInFirstWeek(4); 216 cal.setWeekDate(2016, 13, Calendar.TUESDAY); 217 assertEquals(Calendar.TUESDAY, cal.get(Calendar.DAY_OF_WEEK)); 218 assertEquals(29, cal.get(Calendar.DAY_OF_MONTH)); 221 cal.setMinimalDaysInFirstWeek(1); 222 cal.setWeekDate(2016, 13, Calendar.TUESDAY); 223 assertEquals(Calendar.TUESDAY, cal.get(Calendar.DAY_OF_WEEK)); 224 assertEquals(22, cal.get(Calendar.DAY_OF_MONTH)); 227 cal 353 checkMillis(Calendar cal, String description, long expectedMillis) argument 357 checkOutsideDst(Calendar cal, String description) argument 362 checkOutsideDst(Calendar cal, String description, int expectedZoneOffset) argument 366 checkInsideDst(Calendar cal, String description) argument 371 checkDstFields(Calendar cal, String description, int expectedZoneOffset, int expectedDstOffset) argument [all...] |
H A D | SimpleTimeZoneTest.java | 210 GregorianCalendar cal = new GregorianCalendar(timeZone, Locale.ENGLISH); 211 cal.setTimeInMillis(startOfYearMillis); 212 int year = cal.get(Calendar.YEAR); 213 while (!timeZone.inDaylightTime(new Date(cal.getTimeInMillis()))) { 215 if (cal.get(Calendar.YEAR) != year) { 219 cal.add(Calendar.HOUR_OF_DAY, 1); 222 cal.add(Calendar.MILLISECOND, -1); 223 assertFalse(timeZone.inDaylightTime(cal.getTime())); 224 cal.add(Calendar.MILLISECOND, 1); 225 long entryPoint = cal 245 formatCalendar(Calendar cal) argument [all...] |
H A D | CalendarTest.java | 46 Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US); 47 assertEquals(0, cal.get(Calendar.ZONE_OFFSET)); 49 cal.setTimeZone(tz); 50 assertEquals(25200000, cal.get(Calendar.ZONE_OFFSET)); 214 GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles")); 216 cal.setTimeInMillis(1454506360000L); 217 checkClear(cal, 0, 28800000); 222 GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles")); 224 cal.setTimeInMillis(1454531560000L); 225 checkClear(cal, 1 228 checkClear(GregorianCalendar cal, int expectedHourOfDay, long expectedMillis) argument [all...] |
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/ |
H A D | SimpleDateFormatTest.java | 257 Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 2, 15, 3, 6); 258 assertFormat(format, " G", cal, " AD", DateFormat.ERA_FIELD); 259 assertFormat(format, " GG", cal, " AD", DateFormat.ERA_FIELD); 260 assertFormat(format, " GGG", cal, " AD", DateFormat.ERA_FIELD); 266 assertFormat(format, " y", cal, " 1999", DateFormat.YEAR_FIELD); 267 assertFormat(format, " yy", cal, " 99", DateFormat.YEAR_FIELD); 274 assertFormat(format, " yyy", cal, " 1999", DateFormat.YEAR_FIELD); 275 assertFormat(format, " yyyy", cal, " 1999", DateFormat.YEAR_FIELD); 276 assertFormat(format, " yyyyy", cal, " 01999", DateFormat.YEAR_FIELD); 278 assertFormat(format, " M", cal, " 394 assertFormat(SimpleDateFormat format, String pattern, Calendar cal, String expected, int field) argument [all...] |
H A D | Support_SimpleDateFormat.java | 50 Calendar cal = new GregorianCalendar(tz); 51 cal.set(1999, Calendar.SEPTEMBER, 13, 17, 19, 01); 52 cal.set(Calendar.MILLISECOND, 0); 53 Date date = cal.getTime(); 134 Calendar cal = new GregorianCalendar(tz); 135 cal.set(1999, Calendar.SEPTEMBER, 13, 17, 19, 01); 136 cal.set(Calendar.MILLISECOND, 0); 137 Date date = cal.getTime();
|
/libcore/support/src/test/java/tests/support/ |
H A D | Support_TimeZone.java | 54 GregorianCalendar cal = new GregorianCalendar(); 55 cal.setTime(p1); 56 int month = cal.get(Calendar.MONTH);
|
/libcore/ojluni/src/main/java/java/text/ |
H A D | CalendarBuilder.java | 103 Calendar establish(Calendar cal) { argument 106 if (weekDate && !cal.isWeekDateSupported()) { 114 cal.clear(); 120 cal.set(index, field[MAX_FIELD + index]); 129 field[MAX_FIELD + DAY_OF_WEEK] : cal.getFirstDayOfWeek(); 130 if (!isValidDayOfWeek(dayOfWeek) && cal.isLenient()) { 143 cal.setWeekDate(field[MAX_FIELD + WEEK_YEAR], weekOfYear, dayOfWeek); 145 return cal;
|
/libcore/ojluni/src/main/java/sun/util/calendar/ |
H A D | CalendarSystem.java | 127 CalendarSystem cal = calendars.get(calendarName); 128 if (cal != null) { 129 return cal; 139 cal = LocalGregorianCalendar.getLocalGregorianCalendar(calendarName); 142 cal = (CalendarSystem) calendarClass.newInstance(); 147 if (cal == null) { 151 CalendarSystem cs = calendars.putIfAbsent(calendarName, cal); 152 return (cs == null) ? cal : cs; 283 * Gregorian cal = CalendarSystem.getGregorianCalendar(); 284 * CalendarDate date = cal [all...] |
/libcore/luni/src/main/java/javax/xml/datatype/ |
H A D | Duration.java | 333 Calendar cal = (Calendar) startInstant.clone(); 334 addTo(cal); 335 return getCalendarTimeInMillis(cal) 371 Calendar cal = new GregorianCalendar(); 372 cal.setTime(startInstant); 373 this.addTo(cal); 374 return getCalendarTimeInMillis(cal) - startInstant.getTime(); 558 Calendar cal = new GregorianCalendar(); 559 cal.setTime(date); 560 this.addTo(cal); 977 getCalendarTimeInMillis(final Calendar cal) argument [all...] |
/libcore/ojluni/src/main/java/java/util/ |
H A D | Date.java | 251 BaseCalendar cal = getCalendarSystem(y); 252 cdate = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.getDefaultRef()); 327 BaseCalendar cal = getCalendarSystem(y); 328 BaseCalendar.Date udate = (BaseCalendar.Date) cal.newCalendarDate(null); 620 BaseCalendar cal = getCalendarSystem(year); 622 BaseCalendar.Date ldate = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.getDefaultRef()); 625 return cal.getTime(ldate); 627 BaseCalendar.Date udate = (BaseCalendar.Date) cal.newCalendarDate(null); // no time zone 630 return cal.getTime(udate) + tzoffset * (60 * 1000); 1136 BaseCalendar cal [all...] |
H A D | SimpleTimeZone.java | 558 BaseCalendar cal = date >= GregorianCalendar.DEFAULT_GREGORIAN_CUTOVER ? 560 BaseCalendar.Date cdate = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE); 562 cal.getCalendarDate(date + rawOffset, cdate); 567 offset = getOffset(cal, cdate, year, date); 626 // year numbers would be convenient to use the UNIX cal 635 BaseCalendar cal = gcal; 636 BaseCalendar.Date cdate = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE); 638 long time = cal.getTime(cdate); // normalize cdate 648 cal = (BaseCalendar) CalendarSystem.forName("julian"); 649 cdate = (BaseCalendar.Date) cal 672 getOffset(BaseCalendar cal, BaseCalendar.Date cdate, int year, long time) argument 724 getStart(BaseCalendar cal, BaseCalendar.Date cdate, int year) argument 733 getEnd(BaseCalendar cal, BaseCalendar.Date cdate, int year) argument 745 getTransition(BaseCalendar cal, BaseCalendar.Date cdate, int mode, int year, int month, int dayOfMonth, int dayOfWeek, int timeOfDay) argument [all...] |
H A D | GregorianCalendar.java | 1272 BaseCalendar cal; 1274 cal = getCutoverCalendarSystem(); 1276 cal = gcal; 1278 cal = getJulianCalendarSystem(); 1282 if (cal.getYearFromFixedDate(day1) != y) { 1288 cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem(); 1289 if (cal.getYearFromFixedDate(fd) != y) { 1457 BaseCalendar cal = (fd >= gregorianCutoverDate) ? gcal : getJulianCalendarSystem(); 1458 BaseCalendar.Date d = (BaseCalendar.Date) cal.newCalendarDate(TimeZone.NO_TIMEZONE); 1459 cal 2938 getFixedDate(BaseCalendar cal, int year, int fieldMask) argument [all...] |
H A D | Calendar.java | 974 Calendar cal = createCalendar(TimeZone.getDefaultRef(), Locale.getDefault(Locale.Category.FORMAT)); 975 cal.sharedZone = true; 976 return cal; 1002 Calendar cal = createCalendar(TimeZone.getDefaultRef(), aLocale); 1003 cal.sharedZone = true; 1004 return cal; 2064 * calls: cal.setTimeZone(EST); cal.set(HOUR, 1); cal.setTimeZone(PST). 2065 * Is cal se [all...] |
/libcore/luni/src/test/java/libcore/icu/ |
H A D | RelativeDateTimeFormatterTest.java | 43 Calendar cal = Calendar.getInstance(tz, en_US); 45 cal.set(2015, Calendar.FEBRUARY, 5, 10, 50, 0); 46 final long baseTime = cal.getTimeInMillis(); 99 Calendar cal = Calendar.getInstance(tz, en_US); 101 cal.set(2015, Calendar.FEBRUARY, 5, 10, 50, 0); 102 final long base = cal.getTimeInMillis(); 356 Calendar cal = Calendar.getInstance(tz, de_DE); 358 cal.set(2015, Calendar.FEBRUARY, 5, 10, 50, 0); 359 final long now = cal.getTimeInMillis(); 384 Calendar cal [all...] |
/libcore/ojluni/src/main/java/java/sql/ |
H A D | CallableStatement.java | 511 * @param cal the <code>Calendar</code> object the driver will use 521 java.sql.Date getDate(int parameterIndex, Calendar cal) argument 536 * @param cal the <code>Calendar</code> object the driver will use 546 java.sql.Time getTime(int parameterIndex, Calendar cal) argument 562 * @param cal the <code>Calendar</code> object the driver will use 572 java.sql.Timestamp getTimestamp(int parameterIndex, Calendar cal) argument 1236 * @param cal the <code>Calendar</code> object the driver will use 1246 void setDate(String parameterName, java.sql.Date x, Calendar cal) argument 1261 * @param cal the <code>Calendar</code> object the driver will use 1271 void setTime(String parameterName, java.sql.Time x, Calendar cal) argument 1296 setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal) argument 1690 getDate(String parameterName, Calendar cal) argument 1716 getTime(String parameterName, Calendar cal) argument 1743 getTimestamp(String parameterName, Calendar cal) argument [all...] |
H A D | PreparedStatement.java | 627 * @param cal the <code>Calendar</code> object the driver will use 634 void setDate(int parameterIndex, java.sql.Date x, Calendar cal) argument 649 * @param cal the <code>Calendar</code> object the driver will use 656 void setTime(int parameterIndex, java.sql.Time x, Calendar cal) argument 671 * @param cal the <code>Calendar</code> object the driver will use 678 void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) argument
|
H A D | ResultSet.java | 2623 * @param cal the <code>java.util.Calendar</code> object 2633 java.sql.Date getDate(int columnIndex, Calendar cal) throws SQLException; argument 2644 * @param cal the <code>java.util.Calendar</code> object 2654 java.sql.Date getDate(String columnLabel, Calendar cal) throws SQLException; argument 2665 * @param cal the <code>java.util.Calendar</code> object 2675 java.sql.Time getTime(int columnIndex, Calendar cal) throws SQLException; argument 2686 * @param cal the <code>java.util.Calendar</code> object 2696 java.sql.Time getTime(String columnLabel, Calendar cal) throws SQLException; argument 2707 * @param cal the <code>java.util.Calendar</code> object 2717 java.sql.Timestamp getTimestamp(int columnIndex, Calendar cal) argument 2739 getTimestamp(String columnLabel, Calendar cal) argument [all...] |
/libcore/ojluni/src/main/java/javax/sql/ |
H A D | RowSet.java | 1684 * @param cal the <code>java.util.Calendar</code> object to use for calculating the date 1687 void setDate(int parameterIndex, java.sql.Date x, Calendar cal) argument 1721 * @param cal the <code>Calendar</code> object the driver will use 1730 void setDate(String parameterName, java.sql.Date x, Calendar cal) argument 1741 * @param cal the <code>java.util.Calendar</code> object to use for calculating the time 1744 void setTime(int parameterIndex, java.sql.Time x, Calendar cal) argument 1776 * @param cal the <code>Calendar</code> object the driver will use 1785 void setTime(String parameterName, java.sql.Time x, Calendar cal) argument 1797 * @param cal the <code>java.util.Calendar</code> object to use for calculating the 1801 void setTimestamp(int parameterIndex, java.sql.Timestamp x, Calendar cal) argument 1825 setTimestamp(String parameterName, java.sql.Timestamp x, Calendar cal) argument [all...] |
/libcore/ojluni/src/main/java/java/net/ |
H A D | HttpCookie.java | 1168 Calendar cal = new GregorianCalendar(GMT); 1172 cal.set(1970, 0, 1, 0, 0, 0); 1175 df.set2DigitYearStart(cal.getTime()); 1177 cal.setTime(df.parse(dateString)); 1181 int year = cal.get(Calendar.YEAR); 1188 cal.set(Calendar.YEAR, year); 1190 return (cal.getTimeInMillis() - whenCreated) / 1000;
|
/libcore/luni/src/test/java/libcore/java/security/cert/ |
H A D | X509CertificateTest.java | 397 Calendar cal = Calendar.getInstance(); 413 cal.setTime(dates[0]); 414 cal.add(Calendar.DAY_OF_MONTH, 1); 415 c.checkValidity(cal.getTime()); 418 cal.setTime(dates[1]); 419 cal.add(Calendar.SECOND, -1); 420 c.checkValidity(cal.getTime()); 423 cal.setTime(dates[0]); 424 cal.add(Calendar.SECOND, -1); 425 c.checkValidity(cal [all...] |