Home
last modified time | relevance | path

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

12

/libcore/ojluni/src/main/java/java/time/
DPeriod.java159 private final int months; field in Period
188 public static Period ofMonths(int months) { in ofMonths() argument
189 return create(0, months, 0); in ofMonths()
230 public static Period of(int years, int months, int days) { in of() argument
231 return create(years, months, days); in of()
265 int months = 0; in from() local
272 months = Math.toIntExact(unitAmount); in from()
279 return create(years, months, days); in from()
334 int months = parseNumber(text, monthMatch, negate); in parse() local
338 return create(years, months, days); in parse()
[all …]
DMonth.java392 public Month plus(long months) { in plus() argument
393 int amount = (int) (months % 12); in plus()
408 public Month minus(long months) { in minus() argument
409 return plus(-(months % 12)); in minus()
DOffsetDateTime.java1234 public OffsetDateTime plusMonths(long months) { in plusMonths() argument
1235 return with(dateTime.plusMonths(months), offset); in plusMonths()
1423 public OffsetDateTime minusMonths(long months) { in minusMonths() argument
1424 …return (months == Long.MIN_VALUE ? plusMonths(Long.MAX_VALUE).plusMonths(1) : plusMonths(-months)); in minusMonths()
DLocalDateTime.java1239 public LocalDateTime plusMonths(long months) { in plusMonths() argument
1240 LocalDate newDate = date.plusMonths(months); in plusMonths()
1437 public LocalDateTime minusMonths(long months) { in minusMonths() argument
1438 …return (months == Long.MIN_VALUE ? plusMonths(Long.MAX_VALUE).plusMonths(1) : plusMonths(-months)); in minusMonths()
DZonedDateTime.java1645 public ZonedDateTime plusMonths(long months) { in plusMonths() argument
1646 return resolveLocal(dateTime.plusMonths(months)); in plusMonths()
1886 public ZonedDateTime minusMonths(long months) { in minusMonths() argument
1887 …return (months == Long.MIN_VALUE ? plusMonths(Long.MAX_VALUE).plusMonths(1) : plusMonths(-months)); in minusMonths()
DLocalDate.java1669 int months = (int) (totalMonths % 12); // safe in until() local
1670 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/ojluni/src/main/java/java/time/chrono/
DChronoPeriodImpl.java122 final int months; field in ChronoPeriodImpl
131 ChronoPeriodImpl(Chronology chrono, int years, int months, int days) { in ChronoPeriodImpl() argument
135 this.months = months; in ChronoPeriodImpl()
145 return months; in get()
166 return years == 0 && months == 0 && days == 0; in isZero()
171 return years < 0 || months < 0 || days < 0; in isNegative()
181 Math.addExact(months, amount.months), in plus()
191 Math.subtractExact(months, amount.months), in minus()
222 Math.multiplyExact(months, scalar), in multipliedBy()
231 long totalMonths = years * monthRange + months; in normalized()
[all …]
DHijrahChronology.java931 int[] months = parseMonths((String) entry.getValue()); in loadCalendarData() local
932 years.put(year, months); in loadCalendarData()
997 int[] months = years.get(year);// must not be gaps in createEpochMonths() local
999 int length = months[month]; in createEpochMonths()
1031 int[] months = new int[12]; in parseMonths() local
1038 months[i] = Integer.valueOf(numbers[i]); in parseMonths()
1043 return months; in parseMonths()
DIsoChronology.java546 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); in resolveYMD() local
548 return LocalDate.of(y, 1, 1).plusMonths(months).plusDays(days); in resolveYMD()
583 public Period period(int years, int months, int days) { in period() argument
584 return Period.of(years, months, days); in period()
DAbstractChronology.java554 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); in resolveYMD() local
556 return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); in resolveYMD()
584 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); in resolveYMAA() local
587 return date(y, 1, 1).plus(months, MONTHS).plus(weeks, WEEKS).plus(days, DAYS); in resolveYMAA()
602 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); in resolveYMAD() local
605 return resolveAligned(date(y, 1, 1), months, weeks, dow); in resolveYMAD()
649 ChronoLocalDate resolveAligned(ChronoLocalDate base, long months, long weeks, long dow) { in resolveAligned() argument
650 ChronoLocalDate date = base.plus(months, MONTHS).plus(weeks, WEEKS); in resolveAligned()
DChronology.java704 default ChronoPeriod period(int years, int months, int days) { in period() argument
705 return new ChronoPeriodImpl(this, years, months, days); in period()
DThaiBuddhistDate.java371 ThaiBuddhistDate plusMonths(long months) { in plusMonths() argument
372 return with(isoDate.plusMonths(months)); in plusMonths()
DMinguoDate.java371 MinguoDate plusMonths(long months) { in plusMonths() argument
372 return with(isoDate.plusMonths(months)); in plusMonths()
DJapaneseChronology.java477 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); in resolveYMD() local
479 return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); in resolveYMD()
DHijrahDate.java601 int months = (int) (totalMonths % 12); // safe in until() local
602 return getChronology().period(Math.toIntExact(years), months, days); in until()
DJapaneseDate.java616 JapaneseDate plusMonths(long months) { in plusMonths() argument
617 return with(isoDate.plusMonths(months)); in plusMonths()
/libcore/ojluni/src/main/java/java/text/
DDateFormatSymbols.java159 String months[] = null; field in DateFormatSymbols
483 return Arrays.copyOf(months, months.length); in getMonths()
491 months = Arrays.copyOf(newMonths, newMonths.length); in setMonths()
743 hashCode = 11 * hashCode + Arrays.hashCode(months); in hashCode()
767 && Arrays.equals(months, that.months) in equals()
835 months = localeData.longMonthNames; in initializeData()
952 dst.months = Arrays.copyOf(src.months, src.months.length); in copyMembers()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DCopticDate.java281 private CopticDate plusMonths(long months) { in plusMonths() argument
282 if (months == 0) { in plusMonths()
286 long calcEm = Math.addExact(curEm, months); in plusMonths()
323 int months = (int) (totalMonths % 13); // safe in until() local
324 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/luni/src/main/java/javax/xml/datatype/
DDatatypeFactory.java234 final BigInteger months, in newDuration() argument
271 final int months, in newDuration() argument
281 …BigInteger realMonths = (months != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) in newDuration()
DDuration.java897 BigInteger months = (BigInteger) getField(DatatypeConstants.MONTHS); in toString() local
898 if (months != null) { in toString()
899 buf.append(months).append('M'); in toString()
/libcore/ojluni/src/main/resources/
Dhijrah-config-umalqura.properties50 # nn is the number of days for a month listed in the order of the months.
51 # * Each year must have 12 months.
53 # * There must be one or more space characters between the months.
/libcore/ojluni/annotations/hiddenapi/java/time/
DOffsetDateTime.java285 public java.time.OffsetDateTime plusMonths(long months) { in plusMonths() argument
326 public java.time.OffsetDateTime minusMonths(long months) { in minusMonths() argument
/libcore/ojluni/src/test/java/time/tck/java/time/
DTCKYearMonth.java712 long months = 20L + Integer.MAX_VALUE; in test_plusMonths_long_big() local
713 …assertEquals(test.plusMonths(months), YearMonth.of((int) (-40L + months / 12), 6 + (int) (months %… in test_plusMonths_long_big()
927 long months = 20L + Integer.MAX_VALUE; in test_minusMonths_long_big() local
928 …assertEquals(test.minusMonths(months), YearMonth.of((int) (40L - months / 12), 6 - (int) (months %… in test_minusMonths_long_big()
DTCKLocalDate.java1147 long months = 20L + Integer.MAX_VALUE;
1148 LocalDate test = LocalDate.of(-40, 6, 1).plusMonths(months);
1149 assertEquals(test, LocalDate.of((int) (-40L + months / 12), 6 + (int) (months % 12), 1));
1502 long months = 20L + Integer.MAX_VALUE;
1503 LocalDate test = LocalDate.of(40, 6, 1).minusMonths(months);
1504 assertEquals(test, LocalDate.of((int) (40L - months / 12), 6 - (int) (months % 12), 1));
/libcore/ojluni/src/test/java/time/test/java/time/chrono/
DTestUmmAlQuraChronology.java325 …st_diffBetweenDates(ChronoLocalDate from, ChronoLocalDate to, long days, long months, long years) { in test_diffBetweenDates() argument
327 assertEquals(from.until(to, ChronoUnit.MONTHS), months); in test_diffBetweenDates() local

12