Home
last modified time | relevance | path

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

123

/libcore/luni/src/test/java/libcore/java/util/
DCalendarTest.java57 Calendar calendar = new GregorianCalendar(AMERICA_SAO_PAULO); in testAddOneDayOverDstForwardAdds23HoursAt0100() local
58 calendar.set(2011, 9, 15, 1, 0); // 01:00 GMT-3 in testAddOneDayOverDstForwardAdds23HoursAt0100()
59 double hoursSinceEpoch = hoursSinceEpoch(calendar); in testAddOneDayOverDstForwardAdds23HoursAt0100()
60 calendar.add(Calendar.DATE, 1); in testAddOneDayOverDstForwardAdds23HoursAt0100()
61 assertEquals(23.0, hoursSinceEpoch(calendar) - hoursSinceEpoch); in testAddOneDayOverDstForwardAdds23HoursAt0100()
62 assertCalendarEquals(calendar, 2011, 9, 16, 1, 0); // 01:00 GMT-2; +23 hours in testAddOneDayOverDstForwardAdds23HoursAt0100()
73 Calendar calendar = new GregorianCalendar(AMERICA_SAO_PAULO); in testAddOneDayOverDstForwardAdds24HoursAt0000() local
74 calendar.set(2011, 9, 15, 0, 0); // 00:00 GMT-3 in testAddOneDayOverDstForwardAdds24HoursAt0000()
75 double hoursSinceEpoch = hoursSinceEpoch(calendar); in testAddOneDayOverDstForwardAdds24HoursAt0000()
76 calendar.add(Calendar.DATE, 1); in testAddOneDayOverDstForwardAdds24HoursAt0000()
[all …]
DGregorianCalendarTest.java292 GregorianCalendar calendar = GregorianCalendar.from(zdt); in test_fromZonedDateTime() local
294 assertEquals(timeZone, calendar.getTimeZone()); in test_fromZonedDateTime()
295 assertEquals(2007, calendar.get(Calendar.YEAR)); in test_fromZonedDateTime()
296 assertEquals(Calendar.DECEMBER, calendar.get(Calendar.MONTH)); in test_fromZonedDateTime()
297 assertEquals(3, calendar.get(Calendar.DAY_OF_MONTH)); in test_fromZonedDateTime()
298 assertEquals(10, calendar.get(Calendar.HOUR_OF_DAY)); in test_fromZonedDateTime()
299 assertEquals(15, calendar.get(Calendar.MINUTE)); in test_fromZonedDateTime()
300 assertEquals(3600 * 1000, calendar.getTimeZone().getRawOffset()); // in milliseconds in test_fromZonedDateTime()
320 GregorianCalendar calendar = new GregorianCalendar(timeZone); in test_toZonedDateTime() local
321 calendar.set(2007, Calendar.DECEMBER, 3, 10, 15, 30); in test_toZonedDateTime()
[all …]
DCalendarWeekOfMonthTest.java219 Calendar calendar = new GregorianCalendar( in test() local
221 calendar.setFirstDayOfWeek(firstDayOfWeek); in test()
222 calendar.setMinimalDaysInFirstWeek(minimalDaysInFirstWeek); in test()
223 calendar.setTimeInMillis(timeInMillis); in test()
225 assertEquals(toString(), expectedWeekOfMonth, calendar.get(Calendar.WEEK_OF_MONTH)); in test()
DSimpleTimeZoneTest.java291 GregorianCalendar calendar = new GregorianCalendar(timeZone, Locale.ENGLISH); in checkDstTransitionTimes() local
292 calendar.set(year, Calendar.JANUARY, 1, 0, 0, 0); in checkDstTransitionTimes()
293 calendar.set(Calendar.MILLISECOND, 0); in checkDstTransitionTimes()
294 long start = calendar.getTimeInMillis(); in checkDstTransitionTimes()
/libcore/luni/src/test/java/libcore/javax/xml/datatype/
DXMLGregorianCalendarTest.java33 private XMLGregorianCalendar calendar; field in XMLGregorianCalendarTest
39 calendar = new XMLGregorianCalendarImpl(); in setUp()
43 assertEquals(DatatypeConstants.FIELD_UNDEFINED, calendar.getMillisecond()); in testGetMillisecond()
47 calendar.setTime(1, 2, 3); in testSetTime_iii()
48 assertEquals(1, calendar.getHour()); in testSetTime_iii()
49 assertEquals(2, calendar.getMinute()); in testSetTime_iii()
50 assertEquals(3, calendar.getSecond()); in testSetTime_iii()
54 calendar.setTime(1, 2, 3, 4); in testSetTime_iiii()
55 assertEquals(1, calendar.getHour()); in testSetTime_iiii()
56 assertEquals(2, calendar.getMinute()); in testSetTime_iiii()
[all …]
DDatatypeFactoryTest.java261 XMLGregorianCalendar calendar = factory.newXMLGregorianCalendar( in testNewXMLGregorianCalendar_iiiiiii() local
263 assertNull(calendar); in testNewXMLGregorianCalendar_iiiiiii()
281 XMLGregorianCalendar calendar = factory.newXMLGregorianCalendarDate(1, 2, 3, 0); in testNewXMLGregorianCalendarDate_iiii() local
282 assertNull(calendar); in testNewXMLGregorianCalendarDate_iiii()
286 XMLGregorianCalendar calendar = factory.newXMLGregorianCalendarTime(4, 5, 6, 0); in testNewXMLGregorianCalendarTime_iiii() local
287 assertNull(calendar); in testNewXMLGregorianCalendarTime_iiii()
291 XMLGregorianCalendar calendar = factory.newXMLGregorianCalendarTime(4, 5, 6, 7, 0); in testNewXMLGregorianCalendarTime_iiiii() local
292 assertNull(calendar); in testNewXMLGregorianCalendarTime_iiiii()
310 …XMLGregorianCalendar calendar = factory.newXMLGregorianCalendarTime(4, 5, 6, BigDecimal.valueOf(7)… in testNewXMLGregorianCalendarTime_BigDecimal() local
311 assertNull(calendar); in testNewXMLGregorianCalendarTime_BigDecimal()
DDurationTest.java101 Calendar calendar = GregorianCalendar.getInstance(); in testGetTimeInMillis_calendar() local
102 calendar.setTimeInMillis(1000); in testGetTimeInMillis_calendar()
104 oneSecond.getTimeInMillis(calendar); in testGetTimeInMillis_calendar()
/libcore/ojluni/annotations/hiddenapi/sun/util/calendar/
DAbstractCalendar.java27 package sun.util.calendar;
30 public abstract class AbstractCalendar extends sun.util.calendar.CalendarSystem {
36 public sun.util.calendar.Era getEra(java.lang.String eraName) { in getEra()
41 public sun.util.calendar.Era[] getEras() { in getEras()
45 public void setEra(sun.util.calendar.CalendarDate date, java.lang.String eraName) { in setEra()
49 protected void setEras(sun.util.calendar.Era[] eras) { in setEras()
53 public sun.util.calendar.CalendarDate getCalendarDate() { in getCalendarDate()
57 public sun.util.calendar.CalendarDate getCalendarDate(long millis) { in getCalendarDate()
61 public sun.util.calendar.CalendarDate getCalendarDate(long millis, java.util.TimeZone zone) { in getCalendarDate()
65 public sun.util.calendar.CalendarDate getCalendarDate( in getCalendarDate()
[all …]
DCalendarSystem.java27 package sun.util.calendar;
38 public static sun.util.calendar.Gregorian getGregorianCalendar() { in getGregorianCalendar()
43 public static sun.util.calendar.CalendarSystem forName(java.lang.String calendarName) { in forName()
53 public abstract sun.util.calendar.CalendarDate getCalendarDate(); in getCalendarDate()
55 public abstract sun.util.calendar.CalendarDate getCalendarDate(long millis); in getCalendarDate()
57 public abstract sun.util.calendar.CalendarDate getCalendarDate( in getCalendarDate()
58 long millis, sun.util.calendar.CalendarDate date); in getCalendarDate()
60 public abstract sun.util.calendar.CalendarDate getCalendarDate( in getCalendarDate()
63 public abstract sun.util.calendar.CalendarDate newCalendarDate(); in newCalendarDate()
66 public abstract sun.util.calendar.CalendarDate newCalendarDate(java.util.TimeZone zone); in newCalendarDate()
[all …]
DLocalGregorianCalendar.java26 package sun.util.calendar;
29 public class LocalGregorianCalendar extends sun.util.calendar.BaseCalendar {
31 private LocalGregorianCalendar(java.lang.String name, sun.util.calendar.Era[] eras) { in LocalGregorianCalendar()
35 static sun.util.calendar.LocalGregorianCalendar getLocalGregorianCalendar( in getLocalGregorianCalendar()
44 public sun.util.calendar.LocalGregorianCalendar.Date getCalendarDate() { in getCalendarDate()
48 public sun.util.calendar.LocalGregorianCalendar.Date getCalendarDate(long millis) { in getCalendarDate()
52 public sun.util.calendar.LocalGregorianCalendar.Date getCalendarDate( in getCalendarDate()
57 public sun.util.calendar.LocalGregorianCalendar.Date getCalendarDate( in getCalendarDate()
58 long millis, sun.util.calendar.CalendarDate date) { in getCalendarDate()
62 private sun.util.calendar.LocalGregorianCalendar.Date adjustYear( in adjustYear()
[all …]
DImmutableGregorianDate.java26 package sun.util.calendar;
29 class ImmutableGregorianDate extends sun.util.calendar.BaseCalendar.Date {
31 ImmutableGregorianDate(sun.util.calendar.BaseCalendar.Date date) { in ImmutableGregorianDate()
35 public sun.util.calendar.Era getEra() { in getEra()
39 public sun.util.calendar.CalendarDate setEra(sun.util.calendar.Era era) { in setEra()
47 public sun.util.calendar.CalendarDate setYear(int year) { in setYear()
51 public sun.util.calendar.CalendarDate addYear(int n) { in addYear()
67 public sun.util.calendar.CalendarDate setMonth(int month) { in setMonth()
71 public sun.util.calendar.CalendarDate addMonth(int n) { in addMonth()
79 public sun.util.calendar.CalendarDate setDayOfMonth(int date) { in setDayOfMonth()
[all …]
DCalendarDate.java26 package sun.util.calendar;
40 public sun.util.calendar.Era getEra() { in getEra()
44 public sun.util.calendar.CalendarDate setEra(sun.util.calendar.Era era) { in setEra()
53 public sun.util.calendar.CalendarDate setYear(int year) { in setYear()
57 public sun.util.calendar.CalendarDate addYear(int n) { in addYear()
74 public sun.util.calendar.CalendarDate setMonth(int month) { in setMonth()
78 public sun.util.calendar.CalendarDate addMonth(int n) { in addMonth()
88 public sun.util.calendar.CalendarDate setDayOfMonth(int date) { in setDayOfMonth()
92 public sun.util.calendar.CalendarDate addDayOfMonth(int n) { in addDayOfMonth()
105 public sun.util.calendar.CalendarDate setHours(int hours) { in setHours()
[all …]
DBaseCalendar.java26 package sun.util.calendar;
29 public abstract class BaseCalendar extends sun.util.calendar.AbstractCalendar {
35 public boolean validate(sun.util.calendar.CalendarDate date) { in validate()
39 public boolean normalize(sun.util.calendar.CalendarDate date) { in normalize()
43 void normalizeMonth(sun.util.calendar.CalendarDate date) { in normalizeMonth()
47 public int getYearLength(sun.util.calendar.CalendarDate date) { in getYearLength()
51 public int getYearLengthInMonths(sun.util.calendar.CalendarDate date) { in getYearLengthInMonths()
55 public int getMonthLength(sun.util.calendar.CalendarDate date) { in getMonthLength()
63 public long getDayOfYear(sun.util.calendar.CalendarDate date) { in getDayOfYear()
71 public long getFixedDate(sun.util.calendar.CalendarDate date) { in getFixedDate()
[all …]
DEra.java26 package sun.util.calendar;
59 public sun.util.calendar.CalendarDate getSinceDate() { in getSinceDate()
105 private final sun.util.calendar.CalendarDate sinceDate;
/libcore/ojluni/src/main/resources/
Dcalendars.properties26 # Japanese imperial calendar
33 calendar.japanese.type: LocalGregorianCalendar
34 calendar.japanese.eras: \
42 # Taiwanese calendar
44 calendar.taiwanese.type: LocalGregorianCalendar
45 calendar.taiwanese.eras: \
49 # Thai Buddhist calendar
51 calendar.thai-buddhist.type: LocalGregorianCalendar
52 calendar.thai-buddhist.eras: \
54 calendar.thai-buddhist.year-boundary: \
[all …]
/libcore/ojluni/src/main/java/java/text/
DDateFormat.java188 protected Calendar calendar; field in DateFormat
696 this.calendar = newCalendar; in setCalendar()
706 return calendar; in getCalendar()
745 calendar.setTimeZone(zone); in setTimeZone()
759 return calendar.getTimeZone(); in getTimeZone()
781 calendar.setLenient(lenient); in setLenient()
797 return calendar.isLenient(); in isLenient()
816 calendar.getFirstDayOfWeek() == other.calendar.getFirstDayOfWeek() && in equals()
817calendar.getMinimalDaysInFirstWeek() == other.calendar.getMinimalDaysInFirstWeek() && in equals()
818 calendar.isLenient() == other.calendar.isLenient() && in equals()
[all …]
DSimpleDateFormat.java63 import sun.util.calendar.CalendarUtils;
756 if (calendar == null) { in initializeCalendar()
762 calendar = Calendar.getInstance(loc); in initializeCalendar()
1019 calendar.setTimeInMillis(System.currentTimeMillis()); in initializeDefaultCentury()
1020 calendar.add( Calendar.YEAR, -80 ); in initializeDefaultCentury()
1021 parseAmbiguousDatesAsAfter(calendar.getTime()); in initializeDefaultCentury()
1029 calendar.setTime(startDate); in parseAmbiguousDatesAsAfter()
1030 defaultCenturyStartYear = calendar.get(Calendar.YEAR); in parseAmbiguousDatesAsAfter()
1094 calendar.setTime(date); in format()
1277 if (calendar.isWeekDateSupported()) { in subFormat()
[all …]
/libcore/luni/src/main/java/libcore/icu/
DSimpleDateFormatData.java58 ExtendedCalendar calendar = ICU.getExtendedCalendar(locale, "gregorian"); in SimpleDateFormatData() local
60 String tmpFullTimeFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
74 longTimeFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
76 mediumTimeFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
78 shortTimeFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
80 fullDateFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
82 longDateFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
84 mediumDateFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
86 shortDateFormat = getDateTimePattern(calendar, in SimpleDateFormatData()
189 private String getDateTimePattern(ExtendedCalendar calendar, int dateStyle, int timeStyle) { in getDateTimePattern() argument
[all …]
DLocaleData.java253 Calendar calendar = Calendar.getInstance(locale); in initializeCalendarData() local
256 calendar.getFirstDayOfWeek()); in initializeCalendarData()
257 minimalDaysInFirstWeek = calendar.getMinimalDaysInFirstWeek(); in initializeCalendarData()
/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/java/text/
DSimpleDateFormatTest.java362 Calendar calendar = new GregorianCalendar(AMERICA_LOS_ANGELES); in testDstZoneNameWithNonDstTimestamp() local
363 calendar.setTime(format.parse("2011-06-21T10:00 Pacific Standard Time")); // 18:00 GMT-8 in testDstZoneNameWithNonDstTimestamp()
364 assertEquals(11, calendar.get(Calendar.HOUR_OF_DAY)); // 18:00 GMT-7 in testDstZoneNameWithNonDstTimestamp()
365 assertEquals(0, calendar.get(Calendar.MINUTE)); in testDstZoneNameWithNonDstTimestamp()
370 Calendar calendar = new GregorianCalendar(AMERICA_LOS_ANGELES); in testNonDstZoneNameWithDstTimestamp() local
371 calendar.setTime(format.parse("2010-12-21T10:00 Pacific Daylight Time")); // 17:00 GMT-7 in testNonDstZoneNameWithDstTimestamp()
372 assertEquals(9, calendar.get(Calendar.HOUR_OF_DAY)); // 17:00 GMT-8 in testNonDstZoneNameWithDstTimestamp()
373 assertEquals(0, calendar.get(Calendar.MINUTE)); in testNonDstZoneNameWithDstTimestamp()
379 Calendar calendar = new GregorianCalendar(AUSTRALIA_LORD_HOWE); in testDstZoneWithNonDstTimestampForNonHourDstZone() local
380 calendar.setTime(format.parse("2011-06-21T20:00 Lord Howe Daylight Time")); // 9:00 GMT+11 in testDstZoneWithNonDstTimestampForNonHourDstZone()
[all …]
/libcore/ojluni/src/main/resources/java/time/chrono/
Dhijrah-config-Hijrah-umalqura_islamic-umalqura.properties24 # This properties file defines a Hijrah calendar variant.
31 # <iso-start> ::= 'iso-start' '=' <start date in the ISO calendar>
40 # Identifies the type of calendar in the standard calendar ID scheme
62 # Standard calendar type specification
/libcore/ojluni/src/main/java/java/time/chrono/
DJapaneseEra.java86 import sun.util.calendar.CalendarDate;
131 static final sun.util.calendar.Era[] ERA_CONFIG;
217 sun.util.calendar.Era getPrivateEra() { in getPrivateEra()
330 static JapaneseEra toJapaneseEra(sun.util.calendar.Era privateEra) { in toJapaneseEra()
339 static sun.util.calendar.Era privateEraFrom(LocalDate isoDate) { in privateEraFrom()
/libcore/luni/src/test/java/tests/targets/security/cert/
DCertificateTest.java250 Calendar calendar = Calendar.getInstance(); in backdate() local
251 calendar.clear(); in backdate()
252 calendar.set(year, Calendar.JANUARY, 1); in backdate()
253 params.setDate(calendar.getTime()); in backdate()
/libcore/ojluni/src/main/java/java/util/
DDate.java36 import sun.util.calendar.BaseCalendar;
37 import sun.util.calendar.CalendarDate;
38 import sun.util.calendar.CalendarSystem;
39 import sun.util.calendar.CalendarUtils;
40 import sun.util.calendar.Era;
41 import sun.util.calendar.Gregorian;

123