/libcore/ojluni/src/main/java/java/time/ |
H A D | Period.java | 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. 157 * The number of months. 159 private final int months; field in class:Period 170 * The months and days units will be zero. 180 * Obtains a {@code Period} representing a number of months. 182 * The resulting period will have the specified months. 185 * @param months the number of months, positive or negative 186 * @return the period of months, no 188 ofMonths(int months) argument 230 of(int years, int months, int days) argument 391 create(int years, int months, int days) argument 405 Period(int years, int months, int days) argument 573 withMonths(int months) argument [all...] |
H A D | Month.java | 85 * {@code Month} is an enum representing the 12 months of the year - 177 * {@code Month} is an enum representing the 12 months of the year. 389 * @param months the months to add, positive or negative 392 public Month plus(long months) { argument 393 int amount = (int) (months % 12); 398 * Returns the month-of-year that is the specified number of months before this one. 405 * @param months the months to subtract, positive or negative 408 public Month minus(long months) { argument [all...] |
H A D | OffsetDateTime.java | 1215 * Returns a copy of this {@code OffsetDateTime} with the specified number of months added. 1217 * This method adds the specified amount to the months field in three steps: 1219 * <li>Add the input months to the month-of-year field</li> 1230 * @param months the months to add, may be negative 1231 * @return an {@code OffsetDateTime} based on this date-time with the months added, not null 1234 public OffsetDateTime plusMonths(long months) { argument 1235 return with(dateTime.plusMonths(months), offset); 1404 * Returns a copy of this {@code OffsetDateTime} with the specified number of months subtracted. 1406 * This method subtracts the specified amount from the months fiel 1423 minusMonths(long months) argument [all...] |
H A D | LocalDateTime.java | 1220 * Returns a copy of this {@code LocalDateTime} with the specified number of months added. 1222 * This method adds the specified amount to the months field in three steps: 1224 * <li>Add the input months to the month-of-year field</li> 1235 * @param months the months to add, may be negative 1236 * @return a {@code LocalDateTime} based on this date-time with the months added, not null 1239 public LocalDateTime plusMonths(long months) { argument 1240 LocalDate newDate = date.plusMonths(months); 1418 * Returns a copy of this {@code LocalDateTime} with the specified number of months subtracted. 1420 * This method subtracts the specified amount from the months fiel 1437 minusMonths(long months) argument [all...] |
H A D | ZonedDateTime.java | 1628 * Returns a copy of this {@code ZonedDateTime} with the specified number of months added. 1631 * {@link LocalDateTime#plusMonths(long) adding months} to the local date-time. 1641 * @param months the months to add, may be negative 1642 * @return a {@code ZonedDateTime} based on this date-time with the months added, not null 1645 public ZonedDateTime plusMonths(long months) { argument 1646 return resolveLocal(dateTime.plusMonths(months)); 1700 * Note that this is a different approach to that used by days, months and years, 1728 * Note that this is a different approach to that used by days, months and years. 1746 * Note that this is a different approach to that used by days, months an 1886 minusMonths(long months) argument [all...] |
H A D | LocalDate.java | 1169 * Returns a {@code LocalDate} with the specified number of months added. 1276 * Returns a copy of this {@code LocalDate} with the specified number of months added. 1278 * This method adds the specified amount to the months field in three steps: 1280 * <li>Add the input months to the month-of-year field</li> 1291 * @param monthsToAdd the months to add, may be negative 1292 * @return a {@code LocalDate} based on this date with the months added, not null 1429 * Returns a copy of this {@code LocalDate} with the specified number of months subtracted. 1431 * This method subtracts the specified amount from the months field in three steps: 1433 * <li>Subtract the input months from the month-of-year field</li> 1444 * @param monthsToSubtract the months t [all...] |
/libcore/ojluni/src/main/java/java/time/chrono/ |
H A D | ChronoPeriodImpl.java | 120 * The number of months. 122 final int months; field in class:ChronoPeriodImpl 131 ChronoPeriodImpl(Chronology chrono, int years, int months, int days) { argument 135 this.months = months; 145 return months; 166 return years == 0 && months == 0 && days == 0; 171 return years < 0 || months < 0 || days < 0; 181 Math.addExact(months, amount.months), [all...] |
H A D | IsoChronology.java | 109 * <li>month-of-year - There are 12 months in an ISO year, numbered from 1 to 12. 435 * the difference in months, then the difference in days. 452 * the difference in months, then the difference in weeks, then in days. 462 * years, months and weeks in {@code ALIGNED_DAY_OF_WEEK_IN_MONTH}. 464 * the years, months and weeks have been handled. 546 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); 548 return LocalDate.of(y, 1, 1).plusMonths(months).plusDays(days); 571 * Obtains a period for this chronology based on years, months and days. 574 * years, months and days. See {@link Period} for further details. 577 * @param months th 583 period(int years, int months, int days) argument [all...] |
H A D | AbstractChronology.java | 390 * then adding the difference in months, then the difference in days. 407 * the difference in months, then the difference in weeks, then in days. 417 * years, months and weeks in {@code ALIGNED_DAY_OF_WEEK_IN_MONTH}. 419 * the years, months and weeks have been handled. 554 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); 556 return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); 584 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); 587 return date(y, 1, 1).plus(months, MONTHS).plus(weeks, WEEKS).plus(days, DAYS); 602 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); 605 return resolveAligned(date(y, 1, 1), months, week 649 resolveAligned(ChronoLocalDate base, long months, long weeks, long dow) argument [all...] |
H A D | HijrahChronology.java | 207 * <td>The lengths of the 12 months of the year separated by whitespace. 892 * of 12 months. 931 int[] months = parseMonths((String) entry.getValue()); 932 years.put(year, months); 997 int[] months = years.get(year);// must not be gaps 999 int length = months[month]; 1023 * Parses the 12 months lengths from a property value for a specific year. 1027 * @throws IllegalArgumentException if the number of months is not 12 1031 int[] months = new int[12]; 1034 throw new IllegalArgumentException("wrong number of months o [all...] |
H A D | Chronology.java | 678 * Obtains a period for this chronology based on years, months and days. 681 * years, months and days. All supplied chronologies use periods 682 * based on years, months and days, however the {@code ChronoPeriod} API 688 * Normalization, addition and subtraction derive the number of months 690 * months within a year is fixed, then the calculation approach for 694 * years, months and days, or where you want direct control, then 700 * @param months the number of years, may be negative 704 default ChronoPeriod period(int years, int months, int days) { argument 705 return new ChronoPeriodImpl(this, years, months, days);
|
H A D | MinguoDate.java | 371 MinguoDate plusMonths(long months) { argument 372 return with(isoDate.plusMonths(months));
|
H A D | ThaiBuddhistDate.java | 371 ThaiBuddhistDate plusMonths(long months) { argument 372 return with(isoDate.plusMonths(months));
|
H A D | HijrahDate.java | 601 int months = (int) (totalMonths % 12); // safe 602 return getChronology().period(Math.toIntExact(years), months, days);
|
H A D | JapaneseChronology.java | 477 long months = Math.subtractExact(fieldValues.remove(MONTH_OF_YEAR), 1); 479 return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS);
|
H A D | JapaneseDate.java | 616 JapaneseDate plusMonths(long months) { argument 617 return with(isoDate.plusMonths(months));
|
/libcore/ojluni/src/main/java/java/text/ |
H A D | DateFormatSymbols.java | 60 * months, the names of the days of the week, and the time zone data. 155 * of 13 strings (some calendars have 13 months), indexed by 159 String months[] = null; field in class:DateFormatSymbols 163 * 13 strings (some calendars have 13 months), indexed by 483 return Arrays.copyOf(months, months.length); 491 months = Arrays.copyOf(newMonths, newMonths.length); 743 hashCode = 11 * hashCode + Arrays.hashCode(months); 767 && Arrays.equals(months, that.months) [all...] |
H A D | SimpleDateFormat.java | 1430 final String[] months; 1432 months = standalone ? formatData.getStandAloneMonths() : formatData.getMonths(); 1434 months = standalone ? formatData.getTinyStandAloneMonths() : formatData.getTinyMonths(); 1436 months = standalone ? formatData.getShortStandAloneMonths() : formatData.getShortMonths(); 1438 months = null; 1441 if (months != null) { 1442 current = months[value];
|
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/ |
H A D | CopticDate.java | 281 private CopticDate plusMonths(long months) { argument 282 if (months == 0) { 286 long calcEm = Math.addExact(curEm, months); 323 int months = (int) (totalMonths % 13); // safe 324 return Period.of(Math.toIntExact(years), months, days);
|
H A D | TCKMinguoChronology.java | 508 long months = mdate1.until(mdate2, ChronoUnit.MONTHS); 509 assertEquals(months, 13);
|
/libcore/luni/src/main/java/javax/xml/datatype/ |
H A D | DatatypeFactory.java | 208 * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p> 220 * @param months of this <code>Duration</code> 234 final BigInteger months, 242 * specifying the <code>Duration</code> as isPositive, years, months, days, hours, minutes, seconds.</p> 249 * @param months of this <code>Duration</code> 262 * BigInteger months, 271 final int months, 280 // months may not be set 281 BigInteger realMonths = (months != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) months) 231 newDuration( final boolean isPositive, final BigInteger years, final BigInteger months, final BigInteger days, final BigInteger hours, final BigInteger minutes, final BigDecimal seconds) argument 268 newDuration( final boolean isPositive, final int years, final int months, final int days, final int hours, final int minutes, final int seconds) argument [all...] |
H A D | Duration.java | 34 * which consists of six fields (years, months, days, hours, 544 * determine the duration of months and years. 644 * "P1M" (1 month) * "12" = "P12M" (12 months) 663 * to days, or year to months, this will cause an 670 * and months fields. 678 * the months field. 701 * <p>Converts the years and months fields into the days field 710 * <li>the years, months and days fields will be added to the {@link Calendar} object 722 * a very large value in the years or months fields.</p> 726 * @return <code>Duration</code> of years and months o [all...] |
/libcore/ojluni/src/test/java/time/tck/java/time/ |
H A D | TCKYearMonth.java | 712 long months = 20L + Integer.MAX_VALUE; 713 assertEquals(test.plusMonths(months), YearMonth.of((int) (-40L + months / 12), 6 + (int) (months % 12))); 927 long months = 20L + Integer.MAX_VALUE; 928 assertEquals(test.minusMonths(months), YearMonth.of((int) (40L - months / 12), 6 - (int) (months % 12)));
|
H A D | TCKLocalDate.java | 1147 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/ |
H A D | TestUmmAlQuraChronology.java | 310 // Data provider to get the difference between two dates in terms of days, months and years 322 // Test to verify the difference between two given dates in terms of days, months and years 324 public void test_diffBetweenDates(ChronoLocalDate from, ChronoLocalDate to, long days, long months, long years) { argument 326 assertEquals(from.until(to, ChronoUnit.MONTHS), months);
|