Home
last modified time | relevance | path

Searched refs:cal (Results 1 – 25 of 25) sorted by relevance

/libcore/luni/src/test/java/tests/api/java/util/
DCalendarTest.java41 Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("EST")); in test_setII() local
43 cal.clear(); in test_setII()
44 cal.set(Calendar.YEAR, 2002); in test_setII()
45 assertTrue("Incorrect result 0: " + cal.getTime().getTime(), cal in test_setII()
48 cal.clear(); in test_setII()
49 cal.set(Calendar.YEAR, 2002); in test_setII()
50 cal.set(Calendar.MONTH, Calendar.MARCH); in test_setII()
51 assertTrue("Incorrect result 0a: " + cal.getTime(), cal.getTime() in test_setII()
54 cal.clear(); in test_setII()
55 cal.set(Calendar.YEAR, 2002); in test_setII()
[all …]
DDateTest.java54 Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 22); in test_ConstructorIII() local
55 assertTrue("Wrong time zone", date.equals(cal.getTime())); in test_ConstructorIII()
313 GregorianCalendar cal = new GregorianCalendar(); in test_parseLjava_lang_String() local
314 cal.setTime(d); in test_parseLjava_lang_String()
315 assertEquals("Parsed incorrect month", 9, cal.get(Calendar.MONTH)); in test_parseLjava_lang_String()
316 assertEquals("Parsed incorrect year", 1998, cal.get(Calendar.YEAR)); in test_parseLjava_lang_String()
317 assertEquals("Parsed incorrect date", 13, cal.get(Calendar.DATE)); in test_parseLjava_lang_String()
326 cal.setTimeZone(TimeZone.getTimeZone("GMT")); in test_parseLjava_lang_String()
327 cal.clear(); in test_parseLjava_lang_String()
328 cal.set(1969, Calendar.JANUARY, 12, 1, 0); in test_parseLjava_lang_String()
[all …]
DSimpleTimeZoneTest.java802 Calendar cal = Calendar.getInstance(); in test_getOffsetJ() local
803 cal.set(1998, Calendar.NOVEMBER, 11, 0, 0); in test_getOffsetJ()
806 assertTrue("Incorrect offset returned", st1.getOffset(cal.getTimeInMillis()) == in test_getOffsetJ()
810 cal.set(1998, Calendar.JUNE, 11, 0, 0); in test_getOffsetJ()
812 .getOffset(cal.getTimeInMillis())); in test_getOffsetJ()
818 cal.set(2099, 01, 1, 0, 0); in test_getOffsetJ()
820 assertEquals(fourHours, st1.getOffset(cal.getTimeInMillis())); in test_getOffsetJ()
/libcore/luni/src/test/java/libcore/java/text/
DOldSimpleDateFormatTest.java52 public void test(String pattern, Calendar cal, String expected, int field) { in test() argument
56 format.format(cal.getTime(), buffer, position); in test()
235 Calendar cal = new GregorianCalendar(1999, Calendar.JUNE, 2, 15, 3, 6); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition() local
236 test.test(" G", cal, " AD", DateFormat.ERA_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
237 test.test(" GG", cal, " AD", DateFormat.ERA_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
238 test.test(" GGG", cal, " AD", DateFormat.ERA_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
242 test.test(" M", cal, " 6", DateFormat.MONTH_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
245 test.test(" MM", cal, " 06", DateFormat.MONTH_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
246 test.test(" MMM", cal, " Jun", DateFormat.MONTH_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
247 test.test(" MMMM", cal, " June", DateFormat.MONTH_FIELD); in test_formatLjava_util_DateLjava_lang_StringBufferLjava_text_FieldPosition()
[all …]
/libcore/luni/src/test/java/libcore/java/util/
DOldFormatterTest.java57 Calendar cal = Calendar.getInstance(); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object() local
60 cal.set(2008, Calendar.SEPTEMBER, 23, 18, 30); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object()
87 fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal, cal, cal); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object()
88 fNoL.format("%tA %tB %td %tT", cal, cal, cal, cal); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object()
95 fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal, cal, cal); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object()
96 fNoL.format("%tA %tB %td %tT", cal, cal, cal, cal); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object()
102 fLoc.format(Locale.US, "%tA %tB %td %tT", cal, cal, cal, cal); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object()
103 fNoL.format("%tA %tB %td %tT", cal, cal, cal, cal); in test_formatLjava_util_LocaleLjava_lang_StringLjava_lang_Object()
DCalendarTest.java45 Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("UTC"), Locale.US); in test_setTimeZone() local
46 assertEquals(0, cal.get(Calendar.ZONE_OFFSET)); in test_setTimeZone()
48 cal.setTimeZone(tz); in test_setTimeZone()
49 assertEquals(25200000, cal.get(Calendar.ZONE_OFFSET)); in test_setTimeZone()
211 GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("America/Los_Angeles")); in test_clear_45877() local
212 cal.set(Calendar.YEAR, 1970); in test_clear_45877()
213 cal.set(Calendar.MONTH, Calendar.JANUARY); in test_clear_45877()
214 cal.set(Calendar.DAY_OF_MONTH, 1); in test_clear_45877()
215 cal.clear(Calendar.HOUR_OF_DAY); in test_clear_45877()
216 cal.clear(Calendar.HOUR); in test_clear_45877()
[all …]
/libcore/luni/src/main/java/java/util/
DDate.java77 GregorianCalendar cal = new GregorianCalendar(false); in Date() local
78 cal.set(1900 + year, month, day); in Date()
79 milliseconds = cal.getTimeInMillis(); in Date()
102 GregorianCalendar cal = new GregorianCalendar(false); in Date() local
103 cal.set(1900 + year, month, day, hour, minute); in Date()
104 milliseconds = cal.getTimeInMillis(); in Date()
129 GregorianCalendar cal = new GregorianCalendar(false); in Date() local
130 cal.set(1900 + year, month, day, hour, minute, second); in Date()
131 milliseconds = cal.getTimeInMillis(); in Date()
328 GregorianCalendar cal = new GregorianCalendar(milliseconds); in getTimezoneOffset() local
[all …]
DSimpleTimeZone.java853 Calendar cal = new GregorianCalendar(this); in writeObject() local
855 cal.set(Calendar.MONTH, endMonth); in writeObject()
856 cal.set(Calendar.DATE, endDay); in writeObject()
857 sEndDay = cal.get(Calendar.DAY_OF_WEEK_IN_MONTH); in writeObject()
859 sEndDayOfWeek = cal.getFirstDayOfWeek(); in writeObject()
863 cal.set(Calendar.MONTH, startMonth); in writeObject()
864 cal.set(Calendar.DATE, startDay); in writeObject()
865 sStartDay = cal.get(Calendar.DAY_OF_WEEK_IN_MONTH); in writeObject()
867 sStartDayOfWeek = cal.getFirstDayOfWeek(); in writeObject()
DCalendar.java865 Calendar cal = (Calendar) object; in equals() local
866 return getTimeInMillis() == cal.getTimeInMillis() in equals()
867 && isLenient() == cal.isLenient() in equals()
868 && getFirstDayOfWeek() == cal.getFirstDayOfWeek() in equals()
869 && getMinimalDaysInFirstWeek() == cal.getMinimalDaysInFirstWeek() in equals()
870 && getTimeZone().equals(cal.getTimeZone()); in equals()
DGregorianCalendar.java1235 GregorianCalendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT")); in setGregorianChange() local
1236 cal.setTime(date); in setGregorianChange()
1237 changeYear = cal.get(YEAR); in setGregorianChange()
1238 if (cal.get(ERA) == BC) { in setGregorianChange()
1243 int dayOfYear = cal.get(DAY_OF_YEAR); in setGregorianChange()
/libcore/luni/src/main/java/java/util/zip/
DZipEntry.java157 GregorianCalendar cal = new GregorianCalendar(); in getTime() local
158 cal.set(Calendar.MILLISECOND, 0); in getTime()
159 cal.set(1980 + ((modDate >> 9) & 0x7f), ((modDate >> 5) & 0xf) - 1, in getTime()
162 return cal.getTime().getTime(); in getTime()
273 GregorianCalendar cal = new GregorianCalendar(); in setTime() local
274 cal.setTime(new Date(value)); in setTime()
275 int year = cal.get(Calendar.YEAR); in setTime()
280 modDate = cal.get(Calendar.DATE); in setTime()
281 modDate = (cal.get(Calendar.MONTH) + 1 << 5) | modDate; in setTime()
282 modDate = ((cal.get(Calendar.YEAR) - 1980) << 9) | modDate; in setTime()
[all …]
/libcore/luni/src/main/java/javax/xml/datatype/
DDuration.java333 Calendar cal = (Calendar) startInstant.clone(); in getTimeInMillis() local
334 addTo(cal); in getTimeInMillis()
335 return getCalendarTimeInMillis(cal) in getTimeInMillis()
371 Calendar cal = new GregorianCalendar(); in getTimeInMillis() local
372 cal.setTime(startInstant); in getTimeInMillis()
373 this.addTo(cal); in getTimeInMillis()
374 return getCalendarTimeInMillis(cal) - startInstant.getTime(); in getTimeInMillis()
558 Calendar cal = new GregorianCalendar(); in addTo() local
559 cal.setTime(date); in addTo()
560 this.addTo(cal); in addTo()
[all …]
DDatatypeFactory.java761 public abstract XMLGregorianCalendar newXMLGregorianCalendar(final GregorianCalendar cal); in newXMLGregorianCalendar() argument
/libcore/luni/src/main/java/java/sql/
DCallableStatement.java308 public Date getDate(int parameterIndex, Calendar cal) throws SQLException; in getDate() argument
342 public Date getDate(String parameterName, Calendar cal) throws SQLException; in getDate() argument
646 public Time getTime(int parameterIndex, Calendar cal) throws SQLException; in getTime() argument
679 public Time getTime(String parameterName, Calendar cal) throws SQLException; in getTime() argument
714 public Timestamp getTimestamp(int parameterIndex, Calendar cal) in getTimestamp() argument
748 public Timestamp getTimestamp(String parameterName, Calendar cal) in getTimestamp() argument
1072 public void setDate(String parameterName, Date theDate, Calendar cal) in setDate() argument
1320 public void setTime(String parameterName, Time theTime, Calendar cal) in setTime() argument
1359 Calendar cal) throws SQLException; in setTimestamp() argument
DPreparedStatement.java342 public void setDate(int parameterIndex, Date theDate, Calendar cal) in setDate() argument
612 public void setTime(int parameterIndex, Time theTime, Calendar cal) in setTime() argument
655 Calendar cal) throws SQLException; in setTimestamp() argument
DResultSet.java576 public Date getDate(int columnIndex, Calendar cal) throws SQLException; in getDate() argument
604 public Date getDate(String columnName, Calendar cal) throws SQLException; in getDate() argument
944 public Time getTime(int columnIndex, Calendar cal) throws SQLException; in getTime() argument
973 public Time getTime(String columnName, Calendar cal) throws SQLException; in getTime() argument
1002 public Timestamp getTimestamp(int columnIndex, Calendar cal) in getTimestamp() argument
1032 public Timestamp getTimestamp(String columnName, Calendar cal) in getTimestamp() argument
/libcore/luni/src/test/java/libcore/java/security/cert/
DX509CertificateTest.java388 Calendar cal = Calendar.getInstance(); in checkValidity() local
404 cal.setTime(dates[0]); in checkValidity()
405 cal.add(Calendar.DAY_OF_MONTH, 1); in checkValidity()
406 c.checkValidity(cal.getTime()); in checkValidity()
409 cal.setTime(dates[1]); in checkValidity()
410 cal.add(Calendar.SECOND, -1); in checkValidity()
411 c.checkValidity(cal.getTime()); in checkValidity()
414 cal.setTime(dates[0]); in checkValidity()
415 cal.add(Calendar.SECOND, -1); in checkValidity()
416 c.checkValidity(cal.getTime()); in checkValidity()
[all …]
DCertificateFactoryTest.java524 GregorianCalendar cal = new GregorianCalendar(); in generateCertificate() local
525 cal.setTimeZone(TimeZone.getTimeZone("UTC")); in generateCertificate()
526 cal.set(2100, 0, 1, 0, 0, 0); // Jan 1, 2100 UTC in generateCertificate()
527 Date expiryDate = cal.getTime(); in generateCertificate()
/libcore/luni/src/test/java/libcore/java/sql/
DOldResultSetGetterTests.java926 Calendar cal = new GregorianCalendar(); in testGetTimeInt() local
927 cal.clear(); in testGetTimeInt()
928 cal.set(Calendar.HOUR_OF_DAY, 12); in testGetTimeInt()
929 cal.set(Calendar.MINUTE, 35); in testGetTimeInt()
930 cal.set(Calendar.SECOND, 45); in testGetTimeInt()
931 cal.set(Calendar.MILLISECOND, 0); in testGetTimeInt()
933 long millis = cal.getTime().getTime(); in testGetTimeInt()
1050 Calendar cal = new GregorianCalendar(); in testGetTimeString() local
1051 cal.clear(); in testGetTimeString()
1052 cal.set(Calendar.HOUR_OF_DAY, 12); in testGetTimeString()
[all …]
DOldPreparedStatementTest.java1353 Calendar cal = new GregorianCalendar(1799, 5, 26); in testSetDate_int_Date() local
1355 new Date(cal.getTimeInMillis()), new Date(Integer.MAX_VALUE), in testSetDate_int_Date()
1411 Calendar cal = new GregorianCalendar(1799,5,26); in testSetDate_int_Date_Calendar() local
1413 Date[] dates = { new Date(cal.getTimeInMillis()), new Date(Integer.MAX_VALUE), in testSetDate_int_Date_Calendar()
/libcore/luni/src/main/java/java/text/
DDateFormat.java620 public void setCalendar(Calendar cal) { in setCalendar() argument
621 calendar = cal; in setCalendar()
DSimpleDateFormat.java1258 Calendar cal = new GregorianCalendar(); in set2DigitYearStart() local
1259 cal.setTime(defaultCenturyStart); in set2DigitYearStart()
1260 creationYear = cal.get(Calendar.YEAR); in set2DigitYearStart()
/libcore/luni/src/test/java/org/apache/harmony/luni/tests/java/net/
DURLConnectionTest.java1163 Calendar cal = new GregorianCalendar(TimeZone.getTimeZone("GMT"));
1164 cal.clear();
1165 cal.set(2000, Calendar.MARCH, 5);
1167 long sinceTime = cal.getTime().getTime();
/libcore/luni/src/main/native/
Dlibcore_icu_ICU.cpp543 UniquePtr<Calendar> cal(Calendar::createInstance(locale, status)); in ICU_initLocaleDataImpl() local
548 setIntegerField(env, localeData, "firstDayOfWeek", cal->getFirstDayOfWeek()); in ICU_initLocaleDataImpl()
549 setIntegerField(env, localeData, "minimalDaysInFirstWeek", cal->getMinimalDaysInFirstWeek()); in ICU_initLocaleDataImpl()
/libcore/luni/src/main/java/org/apache/harmony/xnet/provider/jsse/
DNativeCrypto.java533 public static native void ASN1_TIME_to_Calendar(long asn1TimeCtx, Calendar cal); in ASN1_TIME_to_Calendar() argument