Home
last modified time | relevance | path

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

12

/libcore/luni/src/main/java/java/util/
DGregorianCalendar.java386 if (field == YEAR || field == MONTH) { in add()
398 set(YEAR, fields[YEAR] + value); in add()
399 int days = daysInMonth(isLeapYear(fields[YEAR]), fields[MONTH]); in add()
492 if (fields[YEAR] == changeYear && gregorianCutover <= time + fields[ZONE_OFFSET]){ in fullFieldsCalc()
496 boolean leapYear = isLeapYear(fields[YEAR]); in fullFieldsCalc()
503 int dstOffset = fields[YEAR] <= 0 ? 0 : getTimeZone().getOffset(AD, in fullFieldsCalc()
504 fields[YEAR], month, date, fields[DAY_OF_WEEK], millis); in fullFieldsCalc()
505 if (fields[YEAR] > 0) { in fullFieldsCalc()
523 … if(fields[YEAR] == changeYear && gregorianCutover <= time - fields[ZONE_OFFSET] + dstOffset){ in fullFieldsCalc()
527 leapYear = isLeapYear(fields[YEAR]); in fullFieldsCalc()
[all …]
DDate.java338 return new GregorianCalendar(milliseconds).get(Calendar.YEAR) - 1900; in getYear()
660 cal.set(Calendar.YEAR, year + 1900); in setYear()
721 result.append(cal.get(Calendar.YEAR)); in toString()
DCalendar.java474 public static final int YEAR = 1; field in Calendar
1142 set(YEAR, year); in set()
DFormatter.java1851 appendLocalized(result, calendar.get(Calendar.YEAR) / 100, 2); in appendT()
1901 appendLocalized(result, calendar.get(Calendar.YEAR), 4); in appendT()
1956 appendLocalized(result, calendar.get(Calendar.YEAR) % 100, 2); in appendT()
/libcore/luni/src/test/java/libcore/java/util/
DDateTest.java49 c.set(Calendar.YEAR, 21); in test_toGMTString_us()
52 c.set(Calendar.YEAR, 321); in test_toGMTString_us()
63 c.set(Calendar.YEAR, 21); in test_toGMTString_nonUs()
66 c.set(Calendar.YEAR, 321); in test_toGMTString_nonUs()
DCalendarTest.java153 assertEquals(year, calendar.get(Calendar.YEAR)); in testSetSelfConsistent()
200 assertEquals(year, calendar.get(Calendar.YEAR)); in assertCalendarEquals()
215 cal.set(Calendar.YEAR, 1970); in test_clear_45877()
DOldGregorianCalendarTest.java61 assertEquals(2008, g.get(Calendar.YEAR)); in test_computeFields()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/
DCalendarTest.java44 cal.set(Calendar.YEAR, 2002); in test_setII()
49 cal.set(Calendar.YEAR, 2002); in test_setII()
55 cal.set(Calendar.YEAR, 2002); in test_setII()
73 cal.set(Calendar.YEAR, 2002); in test_setII()
79 cal.set(Calendar.YEAR, 2002); in test_setII()
85 cal.set(Calendar.YEAR, 2002); in test_setII()
91 cal.set(Calendar.YEAR, 2002); in test_setII()
97 cal.set(Calendar.YEAR, 2002); in test_setII()
103 cal.set(Calendar.YEAR, 2002); in test_setII()
109 cal.set(Calendar.YEAR, 2002); in test_setII()
[all …]
DGregorianCalendarTest.java50 1972, gc.get(Calendar.YEAR)); in test_ConstructorIII()
68 1972, gc.get(Calendar.YEAR)); in test_ConstructorIIIII()
84 5983, gc.get(Calendar.YEAR)); in test_ConstructorIIIII()
97 1972, gc.get(Calendar.YEAR)); in test_ConstructorIIIIII()
151 c1.set(Calendar.YEAR, 1999); in test_ConstructorLjava_util_TimeZone()
190 gc1.add(GregorianCalendar.YEAR, 1); in test_addII()
192 1999, gc1.get(GregorianCalendar.YEAR)); in test_addII()
196 assertEquals("Wrong result year 1", 2000, gc1.get(Calendar.YEAR)); in test_addII()
201 gc1.add(Calendar.YEAR, -1); in test_addII()
202 assertEquals("Wrong result year 2", 1999, gc1.get(Calendar.YEAR)); in test_addII()
[all …]
DDateTest.java306 assertEquals("Parsed incorrect year", 1998, cal.get(Calendar.YEAR)); in test_parseLjava_lang_String()
445 cal.set(Calendar.YEAR, 1970); in test_toString()
/libcore/luni/src/test/java/libcore/icu/
DDateIntervalFormatTest.java29 private static final long YEAR = 12 * MONTH; field in DateIntervalFormatTest
44 c.set(Calendar.YEAR, 2009); in test_formatDateInterval()
81 …assertEquals("1/19/2009 – 2/9/2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, F… in test_formatDateInterval()
86 …2009 - 09.02.2012", formatDateRange(de_DE, tz, fixedTime, fixedTime + 3 * YEAR, FORMAT_SHOW_YEAR |… in test_formatDateInterval()
91 …assertEquals("19/1/2009–9/2/2012", formatDateRange(es_US, tz, fixedTime, fixedTime + 3 * YEAR, FOR… in test_formatDateInterval()
96 …assertEquals("19/1/2009–9/2/2012", formatDateRange(es_ES, tz, fixedTime, fixedTime + 3 * YEAR, FOR… in test_formatDateInterval()
110 …009 – Feb 9, 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, FORMAT_SHOW_DATE |… in test_formatDateInterval()
111 …assertEquals("Jan 2009 – Feb 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, FO… in test_formatDateInterval()
112 …uary 19, 2009 – February 9, 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, 0)); in test_formatDateInterval()
113 … February 9, 2012", formatDateRange(en_US, tz, fixedTime, fixedTime + 3 * YEAR, FORMAT_SHOW_WEEKDA… in test_formatDateInterval()
[all …]
/libcore/luni/src/main/java/libcore/icu/
DDateIntervalFormat.java209 return c1.get(Calendar.YEAR) != c2.get(Calendar.YEAR) || in fallOnDifferentDates()
219 return c1.get(Calendar.YEAR) == c2.get(Calendar.YEAR); in fallInSameYear()
224 return c.get(Calendar.YEAR) == now.get(Calendar.YEAR); in isThisYear()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/text/
DSupport_SimpleDateFormat.java76 t_FormatWithField(1, format, date, null, Field.YEAR, 6, 10); in t_format_with_FieldPosition()
107 t_FormatWithField(25, format, date, null, Field.YEAR, 0, 0); in t_format_with_FieldPosition()
161 v.add(new FieldContainer(0, 4, Field.YEAR)); in getDateVector1()
177 v.add(new FieldContainer(18, 22, Field.YEAR)); in getDateVector2()
210 v.add(new FieldContainer(6, 10, Field.YEAR)); in getDateVector4()
211 v.add(new FieldContainer(11, 13, Field.YEAR)); in getDateVector4()
212 v.add(new FieldContainer(14, 18, Field.YEAR)); in getDateVector4()
DSimpleDateFormatTest.java512 int year = cal.get(Calendar.YEAR); in test_get2DigitYearStart()
514 assertTrue("Wrong default year start", cal.get(Calendar.YEAR) == (year - 80)); in test_get2DigitYearStart()
731 assertEquals("Incorrect year 2049", 2049, cal.get(Calendar.YEAR)); in test_set2DigitYearStartLjava_util_Date()
733 int year = cal.get(Calendar.YEAR); in test_set2DigitYearStartLjava_util_Date()
737 assertEquals("Incorrect year 2000", 2000, cal.get(Calendar.YEAR)); in test_set2DigitYearStartLjava_util_Date()
740 assertEquals("Incorrect year 50", 50, cal.get(Calendar.YEAR)); in test_set2DigitYearStartLjava_util_Date()
DSupport_MessageFormat.java92 v.add(new FieldContainer(11, 15, DateFormat.Field.YEAR)); in getMessageVector1()
/libcore/luni/src/main/java/org/apache/harmony/security/asn1/
DASN1Time.java45 c.set(Calendar.YEAR, in.times[0]); in getDecodedObject()
/libcore/luni/src/test/java/libcore/java/sql/
DOldResultSetGetterTests.java939 cal2.set(Calendar.YEAR, 2007); in testGetTimeInt()
996 cal2.set(Calendar.YEAR, 2007); in testGetTimeIntCalendar()
1069 cal2.set(Calendar.YEAR, 2007); in testGetTimeString()
1121 cal2.set(Calendar.YEAR, 2007); in testGetTimeStringCalendar()
1168 cal2.set(Calendar.YEAR, 2007); in testGetTimestampInt()
1181 cal3.set(Calendar.YEAR, 1221); in testGetTimestampInt()
1225 cal2.set(Calendar.YEAR, 2007); in testGetTimestampIntCalendar()
1238 cal3.set(Calendar.YEAR, 1221); in testGetTimestampIntCalendar()
1288 cal2.set(Calendar.YEAR, 2007); in testGetTimestampString()
1301 cal3.set(Calendar.YEAR, 1221); in testGetTimestampString()
[all …]
/libcore/luni/src/main/java/java/util/zip/
DZipEntry.java291 int year = cal.get(Calendar.YEAR); in setTime()
298 modDate = ((cal.get(Calendar.YEAR) - 1980) << 9) | modDate; in setTime()
/libcore/luni/src/main/java/java/text/
DSimpleDateFormat.java366 calendar.add(Calendar.YEAR, -80); in SimpleDateFormat()
367 creationYear = calendar.get(Calendar.YEAR); in SimpleDateFormat()
583 dateFormatField = Field.YEAR; in append()
584 int year = calendar.get(Calendar.YEAR); in append()
862 field = Calendar.YEAR; in parse()
877 calendar.set(Calendar.YEAR, year); in parse()
1278 creationYear = cal.get(Calendar.YEAR); in set2DigitYearStart()
DDateFormat.java704 public static final Field YEAR = new Field("year", Calendar.YEAR); field in DateFormat.Field
/libcore/support/src/test/java/tests/support/
DSupport_MessageFormat.java94 v.add(new FieldContainer(11, 15, DateFormat.Field.YEAR)); in getMessageVector1()
/libcore/luni/src/main/java/libcore/util/
DZoneInfo.java811 calendar.set(Calendar.YEAR, year);
820 year = calendar.get(Calendar.YEAR);
/libcore/luni/src/test/java/org/apache/harmony/security/tests/java/security/
DKeyStore2Test.java683 int yearExpected = Calendar.getInstance().get(Calendar.YEAR); in test_getCreationDate()
690 int yearActual1 = Calendar.getInstance().get(Calendar.YEAR); in test_getCreationDate()
704 int yearActual2 = Calendar.getInstance().get(Calendar.YEAR); in test_getCreationDate()
/libcore/luni/src/test/java/libcore/java/security/cert/
DX509CertificateTest.java440 cal.add(Calendar.YEAR, 1); in checkValidity()
/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/io/
DSerializationStressTest4.java1766 DateFormat.Field.YEAR, in test_writeObject_DateFormat_Field()

12