Home
last modified time | relevance | path

Searched refs:calendar (Results 1 – 13 of 13) sorted by relevance

/libcore/luni/src/test/java/libcore/java/util/
DCalendarTest.java54 Calendar calendar = new GregorianCalendar(AMERICA_SAO_PAULO); in testAddOneDayOverDstForwardAdds23HoursAt0100() local
55 calendar.set(2011, 9, 15, 1, 0); // 01:00 GMT-3 in testAddOneDayOverDstForwardAdds23HoursAt0100()
56 double hoursSinceEpoch = hoursSinceEpoch(calendar); in testAddOneDayOverDstForwardAdds23HoursAt0100()
57 calendar.add(Calendar.DATE, 1); in testAddOneDayOverDstForwardAdds23HoursAt0100()
58 assertEquals(23.0, hoursSinceEpoch(calendar) - hoursSinceEpoch); in testAddOneDayOverDstForwardAdds23HoursAt0100()
59 assertCalendarEquals(calendar, 2011, 9, 16, 1, 0); // 01:00 GMT-2; +23 hours in testAddOneDayOverDstForwardAdds23HoursAt0100()
70 Calendar calendar = new GregorianCalendar(AMERICA_SAO_PAULO); in testAddOneDayOverDstForwardAdds24HoursAt0000() local
71 calendar.set(2011, 9, 15, 0, 0); // 00:00 GMT-3 in testAddOneDayOverDstForwardAdds24HoursAt0000()
72 double hoursSinceEpoch = hoursSinceEpoch(calendar); in testAddOneDayOverDstForwardAdds24HoursAt0000()
73 calendar.add(Calendar.DATE, 1); in testAddOneDayOverDstForwardAdds24HoursAt0000()
[all …]
/libcore/luni/src/main/java/java/text/
DDateFormat.java79 protected Calendar calendar; field in DateFormat
237 clone.calendar = (Calendar) calendar.clone(); in clone()
263 && calendar.getTimeZone().equals( in equals()
264 dateFormat.calendar.getTimeZone()) in equals()
265 && calendar.getFirstDayOfWeek() == dateFormat.calendar in equals()
267 && calendar.getMinimalDaysInFirstWeek() == dateFormat.calendar in equals()
269 && calendar.isLenient() == dateFormat.calendar.isLenient(); in equals()
352 return calendar; in getCalendar()
544 return calendar.getTimeZone(); in getTimeZone()
549 return calendar.getFirstDayOfWeek() in hashCode()
[all …]
DSimpleDateFormat.java365 calendar = new GregorianCalendar(locale); in SimpleDateFormat()
366 calendar.add(Calendar.YEAR, -80); in SimpleDateFormat()
367 creationYear = calendar.get(Calendar.YEAR); in SimpleDateFormat()
368 defaultCenturyStart = calendar.getTime(); in SimpleDateFormat()
518 calendar.setTime(date); in formatImpl()
580 buffer.append(formatData.eras[calendar.get(Calendar.ERA)]); in append()
584 int year = calendar.get(Calendar.YEAR); in append()
610 int hour = calendar.get(Calendar.HOUR_OF_DAY); in append()
627 appendMilliseconds(buffer, count, calendar.get(Calendar.MILLISECOND)); in append()
655 buffer.append(formatData.ampms[calendar.get(Calendar.AM_PM)]); in append()
[all …]
/libcore/luni/src/main/java/java/util/
DFormatter.java1813 Calendar calendar; in transformFromDateTime() local
1815 calendar = (Calendar) arg; in transformFromDateTime()
1825 calendar = Calendar.getInstance(locale); in transformFromDateTime()
1826 calendar.setTime(date); in transformFromDateTime()
1830 if (!appendT(result, formatToken.getDateSuffix(), calendar)) { in transformFromDateTime()
1836 private boolean appendT(StringBuilder result, char conversion, Calendar calendar) { in appendT() argument
1839 result.append(localeData.longWeekdayNames[calendar.get(Calendar.DAY_OF_WEEK)]); in appendT()
1842 result.append(localeData.shortWeekdayNames[calendar.get(Calendar.DAY_OF_WEEK)]); in appendT()
1845 result.append(localeData.longMonthNames[calendar.get(Calendar.MONTH)]); in appendT()
1848 result.append(localeData.shortMonthNames[calendar.get(Calendar.MONTH)]); in appendT()
[all …]
DCalendar.java762 public boolean after(Object calendar) { in after() argument
763 if (!(calendar instanceof Calendar)) { in after()
766 return getTimeInMillis() > ((Calendar) calendar).getTimeInMillis(); in after()
781 public boolean before(Object calendar) { in before() argument
782 if (!(calendar instanceof Calendar)) { in before()
785 return getTimeInMillis() < ((Calendar) calendar).getTimeInMillis(); in before()
/libcore/benchmarks/src/benchmarks/regression/
DDateToStringBenchmark.java29 Calendar calendar; field in DateToStringBenchmark
35 calendar = new GregorianCalendar(); in setUp()
36 calendar.setTime(date); in setUp()
60 DateFormat.format("EEE MMM dd HH:mm:ss zzz yyyy", calendar); in timeDateToString_AndroidDateFormat()
/libcore/luni/src/main/java/libcore/util/
DZoneInfo.java349 private final GregorianCalendar calendar; field in ZoneInfo.WallTime
363 this.calendar = createGregorianCalendar(); in WallTime()
364 calendar.setTimeZone(TimeZone.getTimeZone("UTC")); in WallTime()
407 calendar.setTimeInMillis(wallTimeSeconds * 1000L); in localtime()
445 final long longWallTimeSeconds = calendar.getTimeInMillis() / 1000; in mktime()
548 calendar.setTimeInMillis(adjustedWallTimeSeconds * 1000L);
811 calendar.set(Calendar.YEAR, year);
812 calendar.set(Calendar.MONTH, month);
813 calendar.set(Calendar.DAY_OF_MONTH, monthDay);
814 calendar.set(Calendar.HOUR_OF_DAY, hour);
[all …]
/libcore/luni/src/test/java/libcore/java/text/
DSimpleDateFormatTest.java283 Calendar calendar = new GregorianCalendar(AMERICA_LOS_ANGELES); in testDstZoneNameWithNonDstTimestamp() local
284 calendar.setTime(format.parse("2011-06-21T10:00 Pacific Standard Time")); // 18:00 GMT-8 in testDstZoneNameWithNonDstTimestamp()
285 assertEquals(11, calendar.get(Calendar.HOUR_OF_DAY)); // 18:00 GMT-7 in testDstZoneNameWithNonDstTimestamp()
286 assertEquals(0, calendar.get(Calendar.MINUTE)); in testDstZoneNameWithNonDstTimestamp()
291 Calendar calendar = new GregorianCalendar(AMERICA_LOS_ANGELES); in testNonDstZoneNameWithDstTimestamp() local
292 calendar.setTime(format.parse("2010-12-21T10:00 Pacific Daylight Time")); // 17:00 GMT-7 in testNonDstZoneNameWithDstTimestamp()
293 assertEquals(9, calendar.get(Calendar.HOUR_OF_DAY)); // 17:00 GMT-8 in testNonDstZoneNameWithDstTimestamp()
294 assertEquals(0, calendar.get(Calendar.MINUTE)); in testNonDstZoneNameWithDstTimestamp()
300 Calendar calendar = new GregorianCalendar(AUSTRALIA_LORD_HOWE); in testDstZoneWithNonDstTimestampForNonHourDstZone() local
301 calendar.setTime(format.parse("2011-06-21T20:00 Lord Howe Daylight Time")); // 9:00 GMT+11 in testDstZoneWithNonDstTimestampForNonHourDstZone()
[all …]
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DCalendarTest.java570 Calendar calendar = Calendar.getInstance(); in test_clear() local
590 calendar.set(2008, 3, 20, 17, 28, 12); in test_clear()
595 calendar.clear(index); in test_clear()
599 calendar.get(index)); in test_clear()
603 calendar.get(index)); in test_clear()
607 + defaults[i] + ".", defaults[i], calendar.get(index)); in test_clear()
612 calendar.set(2008, 3, 20, 17, 28, 12); in test_clear()
614 calendar.clear(); in test_clear()
619 + defaults[i] + ".", defaults[i], calendar.get(index)); in test_clear()
627 Calendar calendar = Calendar.getInstance(); in test_isSet() local
[all …]
/libcore/luni/src/test/java/libcore/icu/
DDateIntervalFormatTest.java371 Calendar calendar = Calendar.getInstance(utc, l); in test8467515() local
372 calendar.clear(); in test8467515()
374 calendar.set(2038, Calendar.JANUARY, 19, 12, 0, 0); in test8467515()
375 t = calendar.getTimeInMillis(); in test8467515()
378 calendar.set(1900, Calendar.JANUARY, 1, 0, 0, 0); in test8467515()
379 t = calendar.getTimeInMillis(); in test8467515()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/javax/security/cert/
DX509CertificateTest.java311 Calendar calendar = Calendar.getInstance(); in testCheckValidity2() local
313 calendar.set(i * 500, Calendar.JANUARY, 1); in testCheckValidity2()
314 date[i] = calendar.getTime(); in testCheckValidity2()
/libcore/luni/src/main/java/javax/xml/datatype/
DDuration.java528 public abstract void addTo(Calendar calendar); in addTo() argument
/libcore/luni/src/main/native/
Dlibcore_icu_ICU.cpp459 ScopedResourceBundle calendar(ures_getByKey(root.get(), "calendar", NULL, &status)); in getAmPmMarkersNarrow() local
463 ScopedResourceBundle gregorian(ures_getByKey(calendar.get(), "gregorian", NULL, &status)); in getAmPmMarkersNarrow()
482 ScopedResourceBundle calendar(ures_getByKey(root.get(), "calendar", NULL, &status)); in getDateTimePatterns() local
486 ScopedResourceBundle gregorian(ures_getByKey(calendar.get(), "gregorian", NULL, &status)); in getDateTimePatterns()