Home
last modified time | relevance | path

Searched refs:days (Results 1 – 25 of 34) sorted by relevance

12

/libcore/ojluni/src/main/java/java/time/
DPeriod.java163 private final int days; field in Period
215 public static Period ofDays(int days) { in ofDays() argument
216 return create(0, 0, days); in ofDays()
230 public static Period of(int years, int months, int days) { in of() argument
231 return create(years, months, days); in of()
266 int days = 0; in from() local
274 days = Math.toIntExact(unitAmount); in from()
279 return create(years, months, days); in from()
336 int days = parseNumber(text, dayMatch, negate); in parse() local
337 days = Math.addExact(days, Math.multiplyExact(weeks, 7)); in parse()
[all …]
DDayOfWeek.java365 public DayOfWeek plus(long days) { in plus() argument
366 int amount = (int) (days % 7); in plus()
381 public DayOfWeek minus(long days) { in minus() argument
382 return plus(-(days % 7)); in minus()
DOffsetDateTime.java1272 public OffsetDateTime plusDays(long days) { in plusDays() argument
1273 return with(dateTime.plusDays(days), offset); in plusDays()
1461 public OffsetDateTime minusDays(long days) { in minusDays() argument
1462 return (days == Long.MIN_VALUE ? plusDays(Long.MAX_VALUE).plusDays(1) : plusDays(-days)); in minusDays()
DLocalDate.java1659 int days = end.day - this.day; in until() local
1660 if (totalMonths > 0 && days < 0) { in until()
1663 days = (int) (end.toEpochDay() - calcDate.toEpochDay()); // safe in until()
1664 } else if (totalMonths < 0 && days > 0) { in until()
1666 days -= end.lengthOfMonth(); in until()
1670 return Period.of(Math.toIntExact(years), months, days); in until()
DLocalDateTime.java1279 public LocalDateTime plusDays(long days) { in plusDays() argument
1280 LocalDate newDate = date.plusDays(days); in plusDays()
1475 public LocalDateTime minusDays(long days) { in minusDays() argument
1476 return (days == Long.MIN_VALUE ? plusDays(Long.MAX_VALUE).plusDays(1) : plusDays(-days)); in minusDays()
/libcore/ojluni/src/main/java/java/time/chrono/
DChronoPeriodImpl.java126 final int days; field in ChronoPeriodImpl
131 ChronoPeriodImpl(Chronology chrono, int years, int months, int days) { in ChronoPeriodImpl() argument
136 this.days = days; in ChronoPeriodImpl()
147 return days; in get()
166 return years == 0 && months == 0 && days == 0; in isZero()
171 return years < 0 || months < 0 || days < 0; in isNegative()
182 Math.addExact(days, amount.days)); in plus()
192 Math.subtractExact(days, amount.days)); in minus()
223 Math.multiplyExact(days, scalar)); in multipliedBy()
237 return new ChronoPeriodImpl(chrono, Math.toIntExact(splitYears), splitMonths, days); in normalized()
[all …]
DHijrahDate.java546 HijrahDate plusDays(long days) { in plusDays() argument
547 return new HijrahDate(chrono, toEpochDay() + days); in plusDays()
591 int days = end.dayOfMonth - this.dayOfMonth; in until() local
592 if (totalMonths > 0 && days < 0) { in until()
595 days = (int) (end.toEpochDay() - calcDate.toEpochDay()); // safe in until()
596 } else if (totalMonths < 0 && days > 0) { in until()
598 days -= end.lengthOfMonth(); in until()
602 return getChronology().period(Math.toIntExact(years), months, days); in until()
DIsoChronology.java547 long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 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.java555 long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 1); in resolveYMD() local
556 return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); in resolveYMD()
574 long days = Math.subtractExact(fieldValues.remove(DAY_OF_YEAR), 1); in resolveYD() local
575 return dateYearDay(y, 1).plus(days, DAYS); in resolveYD()
586 long days = Math.subtractExact(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_MONTH), 1); in resolveYMAA() local
587 return date(y, 1, 1).plus(months, MONTHS).plus(weeks, WEEKS).plus(days, DAYS); in resolveYMAA()
621 long days = Math.subtractExact(fieldValues.remove(ALIGNED_DAY_OF_WEEK_IN_YEAR), 1); in resolveYAA() local
622 return dateYearDay(y, 1).plus(weeks, WEEKS).plus(days, DAYS); in resolveYAA()
DJapaneseChronology.java478 long days = Math.subtractExact(fieldValues.remove(DAY_OF_MONTH), 1); in resolveYMD() local
479 return date(y, 1, 1).plus(months, MONTHS).plus(days, DAYS); in resolveYMD()
510 long days = Math.subtractExact(fieldValues.remove(DAY_OF_YEAR), 1); in resolveYD() local
511 return dateYearDay(y, 1).plus(days, DAYS); in resolveYD()
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.java381 ThaiBuddhistDate plusDays(long days) { in plusDays() argument
382 return with(isoDate.plusDays(days)); in plusDays()
DMinguoDate.java381 MinguoDate plusDays(long days) { in plusDays() argument
382 return with(isoDate.plusDays(days)); in plusDays()
DChronoLocalDateTimeImpl.java321 private ChronoLocalDateTimeImpl<D> plusDays(long days) { in plusDays() argument
322 return with(date.plus(days, ChronoUnit.DAYS), time); in plusDays()
/libcore/ojluni/src/main/java/sun/util/calendar/
DAbstractCalendar.java120 long days = 0; // fixed date in getCalendarDate() local
144 days = zoneOffset / DAY_IN_MILLIS; in getCalendarDate()
151 days += millis / DAY_IN_MILLIS; in getCalendarDate()
156 ++days; in getCalendarDate()
162 --days; in getCalendarDate()
167 days += EPOCH_OFFSET; in getCalendarDate()
170 getCalendarDateFromFixedDate(date, days); in getCalendarDate()
383 long days = 0; in normalizeTime() local
386 days = fraction / DAY_IN_MILLIS; in normalizeTime()
389 days = CalendarUtils.floorDivide(fraction, DAY_IN_MILLIS); in normalizeTime()
[all …]
DJulianCalendar.java160 long days = JULIAN_EPOCH - 1 + (365 * (y - 1)) + dayOfMonth; in getFixedDate() local
163 days += (y - 1) / 4; in getFixedDate()
166 days += CalendarUtils.floorDivide(y - 1, 4); in getFixedDate()
169 days += ((367 * (long) month) - 362) / 12; in getFixedDate()
171 days += CalendarUtils.floorDivide((367 * (long) month) - 362, 12); in getFixedDate()
174 days -= CalendarUtils.isJulianLeapYear(jyear) ? 1 : 2; in getFixedDate()
179 cache.setCache(jyear, days, CalendarUtils.isJulianLeapYear(jyear) ? 366 : 365); in getFixedDate()
182 return days; in getFixedDate()
/libcore/ojluni/src/test/java/time/test/java/time/
DTestLocalDate.java263 for (int days = 0; days < 365 * 8; days++) { in test_plusDays_symmetry()
264 LocalDate t = reference.plusDays(days).plusDays(-days); in test_plusDays_symmetry()
267 t = reference.plusDays(-days).plusDays(days); in test_plusDays_symmetry()
391 for (int days = 0; days < 365 * 8; days++) { in test_minusDays_symmetry()
392 LocalDate t = reference.minusDays(days).minusDays(-days); in test_minusDays_symmetry()
395 t = reference.minusDays(-days).minusDays(days); in test_minusDays_symmetry()
DTestOffsetDateTime_instants.java134 long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; in factory_ofInstant_tooLow() local
135 Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L); in factory_ofInstant_tooLow()
147 long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; in factory_ofInstant_tooBig() local
148 Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L); in factory_ofInstant_tooBig()
156 long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; in factory_ofInstant_minWithMinOffset() local
157 … Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L - OFFSET_MIN.getTotalSeconds()); in factory_ofInstant_minWithMinOffset()
172 long days = (year * 365L + (year / 4 - year / 100 + year / 400)) - days_0000_to_1970; in factory_ofInstant_minWithMaxOffset() local
173 … Instant instant = Instant.ofEpochSecond(days * 24L * 60L * 60L - OFFSET_MAX.getTotalSeconds()); in factory_ofInstant_minWithMaxOffset()
188 long days = (year * 365L + (year / 4 - year / 100 + year / 400)) + 365 - days_0000_to_1970; in factory_ofInstant_maxWithMinOffset() local
189 …Instant instant = Instant.ofEpochSecond((days + 1) * 24L * 60L * 60L - 1 - OFFSET_MIN.getTotalSeco… in factory_ofInstant_maxWithMinOffset()
[all …]
/libcore/luni/src/main/java/javax/xml/datatype/
DDatatypeFactory.java235 final BigInteger days, in newDuration() argument
272 final int days, in newDuration() argument
284 …BigInteger realDays = (days != DatatypeConstants.FIELD_UNDEFINED) ? BigInteger.valueOf((long) days in newDuration()
414 long days = val / 24L; in newDurationDayTime() local
415 if (days <= ((long) Integer.MAX_VALUE)) { in newDurationDayTime()
417 DatatypeConstants.FIELD_UNDEFINED, (int) days, hours, minutes, seconds); in newDurationDayTime()
421 BigInteger.valueOf(days), BigInteger.valueOf(hours), in newDurationDayTime()
432 BigInteger days = BigInteger.valueOf(val); in newDurationDayTime() local
433 return newDuration(isPositive, null, null, days, hours, minutes, seconds); in newDurationDayTime()
DDuration.java902 BigInteger days = (BigInteger) getField(DatatypeConstants.DAYS); in toString() local
903 if (days != null) { in toString()
904 buf.append(days).append('D'); in toString()
/libcore/ojluni/src/test/java/time/tck/java/time/chrono/
DCopticDate.java292 private CopticDate plusDays(long days) { in plusDays() argument
293 if (days == 0) { in plusDays()
296 return CopticDate.ofEpochDay(Math.addExact(toEpochDay(), days)); in plusDays()
313 int days = end.day - this.day; in until() local
314 if (totalMonths > 0 && days < 0) { in until()
317 days = (int) (end.toEpochDay() - calcDate.toEpochDay()); // safe in until()
318 } else if (totalMonths < 0 && days > 0) { in until()
320 days -= end.lengthOfMonth(); in until()
324 return Period.of(Math.toIntExact(years), months, days); in until()
/libcore/ojluni/src/main/java/java/nio/file/attribute/
DFileTime.java316 private long toExcessNanos(long days) { in toExcessNanos() argument
318 return unit.toNanos(value - unit.convert(days, TimeUnit.DAYS)); in toExcessNanos()
321 - TimeUnit.DAYS.toSeconds(days)); in toExcessNanos()
359 long days = toDays(); in compareTo() local
361 if (days == daysOther) { in compareTo()
362 return Long.compare(toExcessNanos(days), other.toExcessNanos(daysOther)); in compareTo()
364 return Long.compare(days, daysOther); in compareTo()
/libcore/ojluni/src/main/java/java/time/temporal/
DWeekFields.java734 int days = -offset + (dow - 1) + (wowby - 1) * 7; in ofWeekBasedYear() local
735 return date.plus(days, DAYS); in ofWeekBasedYear()
962 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoM() local
963 date = date.plus(Math.addExact(Math.multiplyExact(weeks, 7), days), DAYS); in resolveWoM()
969 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoM() local
970 date = date.plus(weeks * 7 + days, DAYS); in resolveWoM()
987 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoY() local
988 date = date.plus(Math.addExact(Math.multiplyExact(weeks, 7), days), DAYS); in resolveWoY()
992 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoY() local
993 date = date.plus(weeks * 7 + days, DAYS); in resolveWoY()
/libcore/ojluni/src/main/resources/
Dhijrah-config-umalqura.properties46 # Number of days for each month of a Hijrah year
50 # nn is the number of days for a month listed in the order of the months.
52 # * Each month should be 29 or 30 days long.
/libcore/ojluni/annotations/hiddenapi/java/time/
DOffsetDateTime.java293 public java.time.OffsetDateTime plusDays(long days) { in plusDays() argument
334 public java.time.OffsetDateTime minusDays(long days) { in minusDays() argument

12