Home
last modified time | relevance | path

Searched refs:days (Results 1 – 25 of 37) 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()
DZonedDateTime.java1689 public ZonedDateTime plusDays(long days) { in plusDays() argument
1690 return resolveLocal(dateTime.plusDays(days)); in plusDays()
1930 public ZonedDateTime minusDays(long days) { in minusDays() argument
1931 return (days == Long.MIN_VALUE ? plusDays(Long.MAX_VALUE).plusDays(1) : plusDays(-days)); in minusDays()
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()
DMinguoDate.java381 MinguoDate plusDays(long days) { in plusDays() argument
382 return with(isoDate.plusDays(days)); in plusDays()
DThaiBuddhistDate.java381 ThaiBuddhistDate plusDays(long days) { in plusDays() argument
382 return with(isoDate.plusDays(days)); in plusDays()
/libcore/ojluni/src/main/java/sun/util/calendar/
DAbstractCalendar.java120 long days = 0; // fixed date in getCalendarDate() local
136 days = zoneOffset / DAY_IN_MILLIS; in getCalendarDate()
143 days += millis / DAY_IN_MILLIS; in getCalendarDate()
148 ++days; in getCalendarDate()
154 --days; in getCalendarDate()
159 days += EPOCH_OFFSET; in getCalendarDate()
162 getCalendarDateFromFixedDate(date, days); in getCalendarDate()
364 long days = 0; in normalizeTime() local
367 days = fraction / DAY_IN_MILLIS; in normalizeTime()
370 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()
DBaseCalendar.java233 int days = normalizeTime(bdate); in normalize() local
235 long d = (long)bdate.getDayOfMonth() + days; in normalize()
333 int days = DAYS_IN_MONTH[month]; in getMonthLength() local
335 days++; in getMonthLength()
337 return days; in getMonthLength()
386 long days = dayOfMonth; in getFixedDate() local
389 days += (365 * prevyear) in getFixedDate()
395 days += (365 * prevyear) in getFixedDate()
403 days -= isLeapYear(year) ? 1 : 2; in getFixedDate()
408 cache.setCache(year, days, isLeapYear(year) ? 366 : 365); in getFixedDate()
[all …]
/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.java735 int days = -offset + (dow - 1) + (wowby - 1) * 7; in ofWeekBasedYear() local
736 return date.plus(days, DAYS); in ofWeekBasedYear()
963 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoM() local
964 date = date.plus(Math.addExact(Math.multiplyExact(weeks, 7), days), DAYS); in resolveWoM()
970 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoM() local
971 date = date.plus(weeks * 7 + days, DAYS); in resolveWoM()
988 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoY() local
989 date = date.plus(Math.addExact(Math.multiplyExact(weeks, 7), days), DAYS); in resolveWoY()
993 int days = localDow - localizedDayOfWeek(date); // safe from overflow in resolveWoY() local
994 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.

12