HomeSort by relevance Sort by last modified time
    Searched refs:YEARS (Results 1 - 25 of 87) sorted by null

1 2 3 4

  /libcore/ojluni/src/test/java/time/test/java/time/chrono/
TestChronoLocalDate.java 89 dates.add(date.minus(10, ChronoUnit.YEARS));
90 dates.add(date.minus(1, ChronoUnit.YEARS));
98 dates.add(date.plus(1, ChronoUnit.YEARS));
99 dates.add(date.plus(10, ChronoUnit.YEARS));
113 dates.add(date.minus(10, ChronoUnit.YEARS));
114 dates.add(date.minus(1, ChronoUnit.YEARS));
122 dates.add(date.plus(1, ChronoUnit.YEARS));
123 dates.add(date.plus(10, ChronoUnit.YEARS));
TestExampleCode.java 109 .plus(1, ChronoUnit.YEARS)
162 .plus(1, ChronoUnit.YEARS)
  /external/icu/android_icu4j/src/main/tests/android/icu/dev/test/format/
RelativeDateTimeFormatterTest.java 61 {0.0, Direction.NEXT, RelativeUnit.YEARS, "in 0 years"},
62 {0.5, Direction.NEXT, RelativeUnit.YEARS, "in 0.5 years"},
63 {1.0, Direction.NEXT, RelativeUnit.YEARS, "in 1 year"},
64 {2.0, Direction.NEXT, RelativeUnit.YEARS, "in 2 years"},
90 {0.0, Direction.LAST, RelativeUnit.YEARS, "0 years ago"},
91 {0.5, Direction.LAST, RelativeUnit.YEARS, "0.5 years ago"}
    [all...]
  /external/icu/icu4j/main/tests/core/src/com/ibm/icu/dev/test/format/
RelativeDateTimeFormatterTest.java 58 {0.0, Direction.NEXT, RelativeUnit.YEARS, "in 0 years"},
59 {0.5, Direction.NEXT, RelativeUnit.YEARS, "in 0.5 years"},
60 {1.0, Direction.NEXT, RelativeUnit.YEARS, "in 1 year"},
61 {2.0, Direction.NEXT, RelativeUnit.YEARS, "in 2 years"},
87 {0.0, Direction.LAST, RelativeUnit.YEARS, "0 years ago"},
88 {0.5, Direction.LAST, RelativeUnit.YEARS, "0.5 years ago"}
    [all...]
  /libcore/ojluni/src/test/java/time/tck/java/time/temporal/serial/
TCKChronoUnitSerialization.java 74 import static java.time.temporal.ChronoUnit.YEARS;
101 {YEARS},
  /libcore/ojluni/src/main/java/java/time/temporal/
ChronoField.java 82 import static java.time.temporal.ChronoUnit.YEARS;
400 * years and 1 to 366 in leap years.
412 DAY_OF_YEAR("DayOfYear", DAYS, YEARS, ValueRange.of(1, 365, 366)),
454 ALIGNED_WEEK_OF_YEAR("AlignedWeekOfYear", WEEKS, YEARS, ValueRange.of(1, 53)),
465 MONTH_OF_YEAR("MonthOfYear", MONTHS, YEARS, ValueRange.of(1, 12), "month"),
520 YEAR_OF_ERA("YearOfEra", YEARS, FOREVER, ValueRange.of(1, Year.MAX_VALUE, Year.MAX_VALUE + 1)),
544 YEAR("Year", YEARS, FOREVER, ValueRange.of(Year.MIN_VALUE, Year.MAX_VALUE), "year"),
    [all...]
TemporalAdjusters.java 69 import static java.time.temporal.ChronoUnit.YEARS;
264 * temporal.with(DAY_OF_YEAR, 1).plus(1, YEARS);
270 return (temporal) -> temporal.with(DAY_OF_YEAR, 1).plus(1, YEARS);
ChronoUnit.java 68 * For example, most non-ISO calendar systems define units of years, months and days,
149 YEARS("Years", Duration.ofSeconds(31556952L)),
152 * For the ISO calendar system, it is equal to 10 years.
155 * and is normally an integral number of years.
160 * For the ISO calendar system, it is equal to 100 years.
163 * and is normally an integral number of years.
168 * For the ISO calendar system, it is equal to 1000 years.
171 * and is normally an integral number of years.
178 * The estimated duration of the era is artificially defined as {@code 1,000,000,000 Years}
    [all...]
WeekFields.java 77 import static java.time.temporal.ChronoUnit.YEARS;
217 * The unit that represents week-based-years for the purpose of addition and subtraction.
219 * This allows a number of week-based-years to be added to, or subtracted from, a date.
224 * The rules for addition add the number of week-based-years to the existing value
694 return new ComputedDayOfField("WeekOfYear", weekDef, WEEKS, YEARS, WEEK_OF_YEAR_RANGE);
    [all...]
  /libcore/ojluni/src/main/java/java/time/chrono/
ChronoPeriodImpl.java 62 import static java.time.temporal.ChronoUnit.YEARS;
109 Collections.unmodifiableList(Arrays.<TemporalUnit>asList(YEARS, MONTHS, DAYS));
116 * The number of years.
118 final int years; field in class:ChronoPeriodImpl
131 ChronoPeriodImpl(Chronology chrono, int years, int months, int days) {
134 this.years = years;
142 if (unit == ChronoUnit.YEARS) {
143 return years;
166 return years == 0 && months == 0 && days == 0
395 int years = in.readInt(); local
    [all...]
ChronoLocalDateImpl.java 88 * For example, the Mayan calendar uses a system that bears no relation to years, months and days.
118 * ChronoLocalDate last = first.plus(1, ChronoUnit.YEARS)
205 case YEARS: return plusYears(amountToAdd);
230 * Returns a copy of this date with the specified number of years added.
232 * This adds the specified period in years to the date.
233 * In some cases, adding years can cause the resulting date to become invalid.
239 * @param yearsToAdd the years to add, may be negative
240 * @return a date based on this one with the years added, not null
295 * Returns a copy of this date with the specified number of years subtracted.
297 * This subtracts the specified period in years to the date
    [all...]
  /libcore/ojluni/src/test/java/time/test/java/time/temporal/
TestChronoUnit.java 69 import static java.time.temporal.ChronoUnit.YEARS;
109 assertEquals(YEARS.between(start, end), expected);
114 assertEquals(YEARS.between(end, start), -expected);
119 assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 30)), expected);
125 assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 31)), expected);
127 assertEquals(YEARS.between(start.atTime(12, 30), end.atTime(12, 29)), expected);
133 assertEquals(YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected);
140 assertEquals(YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(2)), end.atStartOfDay(ZoneOffset.ofHours(1))), expected);
142 assertEquals(YEARS.between(start.atStartOfDay(ZoneOffset.ofHours(1)), end.atStartOfDay(ZoneOffset.ofHours(2))), expected);
  /libcore/ojluni/src/test/java/time/tck/java/time/
TCKYear.java 70 import static java.time.temporal.ChronoUnit.YEARS;
384 assertEquals(TEST_2008.isSupported(ChronoUnit.YEARS), true);
417 {TEST_2008, TemporalQueries.precision(), ChronoUnit.YEARS},
548 long years = 20L + Year.MAX_VALUE; local
549 assertEquals(Year.of(-40).plusYears(years), Year.of((int) (-40L + years)));
578 {Year.of(1), 1, ChronoUnit.YEARS, Year.of(2), null},
579 {Year.of(1), -12, ChronoUnit.YEARS, Year.of(-11), null},
580 {Year.of(1), 0, ChronoUnit.YEARS, Year.of(1), null},
581 {Year.of(999999999), 0, ChronoUnit.YEARS, Year.of(999999999), null}
680 long years = 20L + Year.MAX_VALUE; local
    [all...]
TCKYearMonth.java 73 import static java.time.temporal.ChronoUnit.YEARS;
449 assertEquals(TEST_2008_06.isSupported(ChronoUnit.YEARS), true);
746 {YearMonth.of(1, 10), 1, ChronoUnit.YEARS, YearMonth.of(2, 10), null},
747 {YearMonth.of(1, 10), -12, ChronoUnit.YEARS, YearMonth.of(-11, 10), null},
748 {YearMonth.of(1, 10), 0, ChronoUnit.YEARS, YearMonth.of(1, 10), null},
749 {YearMonth.of(999999999, 12), 0, ChronoUnit.YEARS, YearMonth.of(999999999, 12), null},
750 {YearMonth.of(-999999999, 1), 0, ChronoUnit.YEARS, YearMonth.of(-999999999, 1), null},
751 {YearMonth.of(0, 1), -999999999, ChronoUnit.YEARS, YearMonth.of(-999999999, 1), null},
752 {YearMonth.of(0, 12), 999999999, ChronoUnit.YEARS, YearMonth.of(999999999, 12), null},
    [all...]
TCKLocalDate.java 82 import static java.time.temporal.ChronoUnit.YEARS;
658 assertEquals(TEST_2007_07_15.isSupported(ChronoUnit.YEARS), true);
    [all...]
  /libcore/ojluni/src/test/java/time/test/java/time/format/
TestReducedParser.java 67 import static java.time.temporal.ChronoUnit.YEARS;
394 {IsoChronology.INSTANCE.date(baseYear).plus(1, YEARS)},
395 {IsoChronology.INSTANCE.date(baseYear).plus(99, YEARS)},
397 {HijrahChronology.INSTANCE.date(baseYear).plus(1, YEARS)},
398 {HijrahChronology.INSTANCE.date(baseYear).plus(99, YEARS)},
400 {JapaneseChronology.INSTANCE.date(baseYear).plus(1, YEARS)},
401 {JapaneseChronology.INSTANCE.date(baseYear).plus(99, YEARS)},
403 {MinguoChronology.INSTANCE.date(baseYear).plus(1, YEARS)},
404 {MinguoChronology.INSTANCE.date(baseYear).plus(99, YEARS)},
406 {ThaiBuddhistChronology.INSTANCE.date(baseYear).plus(1, YEARS)},
    [all...]
  /libcore/luni/src/main/java/javax/xml/datatype/
DatatypeConstants.java 127 * <p>A constant that represents the years field.</p>
129 public static final Field YEARS = new Field("YEARS", 0);
Duration.java 34 * which consists of six fields (years, months, days, hours,
158 boolean yearSet = isSet(DatatypeConstants.YEARS);
218 * <p>Get the years value of this <code>Duration</code> as an <code>int</code> or <code>0</code> if not present.</p>
221 * {@link #getField(DatatypeConstants.Field field) getField(DatatypeConstants.YEARS)}.</p>
224 * with years that go beyond the range of an <code>int</code>.
225 * Use {@link #getField(DatatypeConstants.Field field) getField(DatatypeConstants.YEARS)} to avoid possible loss of precision.</p>
227 * @return If the years field is present, return its value as an <code>int</code>, else return <code>0</code>.
230 return getFieldValueAsInt(DatatypeConstants.YEARS);
383 * In case of YEARS, MONTHS, DAYS, HOURS, and MINUTES, the returned
388 * one of the six Field constants (YEARS,MONTHS,DAYS,HOURS
892 BigInteger years = (BigInteger) getField(DatatypeConstants.YEARS); local
    [all...]
  /libcore/luni/src/test/java/libcore/java/time/
InstantTest.java 46 assertEquals(false, Instant.EPOCH.isSupported(ChronoUnit.YEARS));
  /libcore/ojluni/src/test/java/time/tck/java/time/temporal/
TCKChronoUnit.java 74 import static java.time.temporal.ChronoUnit.YEARS;
106 {YEARS, true, false, true},
137 {YEARS, LocalDate.of(2000, 1, 10), true, 1, LocalDate.of(2001, 1, 10)},
152 {YEARS, LocalTime.of(1, 2, 3, 400), false, 1, null},
TCKChronoField.java 97 import static java.time.temporal.ChronoUnit.YEARS;
125 {YEAR, YEARS, FOREVER},
126 {MONTH_OF_YEAR, MONTHS, YEARS},
129 {DAY_OF_YEAR, DAYS, YEARS},
  /libcore/ojluni/src/main/java/java/time/
Period.java 66 import static java.time.temporal.ChronoUnit.YEARS;
96 * such as '2 years, 3 months and 4 days'.
98 * This class models a quantity or amount of time in terms of years, months and days.
113 * The supported units of a period are {@link ChronoUnit#YEARS YEARS},
119 * system, in which today's rules for leap years are applied for all time.
150 Collections.unmodifiableList(Arrays.<TemporalUnit>asList(YEARS, MONTHS, DAYS));
153 * The number of years.
155 private final int years; field in class:Period
167 * Obtains a {@code Period} representing a number of years
264 int years = 0; local
333 int years = parseNumber(text, yearMatch, negate); local
1069 int years = in.readInt(); local
    [all...]
Year.java 71 import static java.time.temporal.ChronoUnit.YEARS;
106 * <b>Note that years in the ISO chronology only align with years in the
107 * Gregorian-Julian system for modern years. Parts of Russia did not switch to the
109 * As such, historical years must be treated with caution.</b>
114 * Years represented by this class follow the ISO-8601 standard and use
119 * system, in which today's rules for leap years are applied for all time.
264 * Years outside the range 0000 to 9999 must be prefixed by the plus or minus symbol.
294 * This method applies the current rules for leap years across the whole time-line.
296 * remainder. However, years divisible by 100, are not leap years, wit
    [all...]
YearMonth.java 74 import static java.time.temporal.ChronoUnit.YEARS;
115 * system, in which today's rules for leap years are applied for all time.
267 * Years outside the range 0000 to 9999 must be prefixed by the plus or minus symbol.
367 * <li>{@code YEARS}
386 return unit == MONTHS || unit == YEARS || unit == DECADES || unit == CENTURIES || unit == MILLENNIA || unit == ERAS;
545 * This method applies the current rules for leap years across the whole time-line.
547 * remainder. However, years divisible by 100, are not leap years, with
548 * the exception of years divisible by 400 which are.
    [all...]
  /libcore/ojluni/src/test/java/time/tck/java/time/chrono/
TCKChronoPeriod.java 62 import static java.time.temporal.ChronoUnit.YEARS;
121 assertEquals(period.get(YEARS), 1);
136 assertEquals(period.getUnits().get(0), YEARS);

Completed in 329 milliseconds

1 2 3 4