Requires year-month-day to be present; if not, a runtime exception is thrown. @param aNumDays can be either sign; if negative, then the days are subtracted.
This method adds the specified amount to the days field incrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded.
For example, 2008-12-31 plus one day would result in 2009-01-01.
This instance is immutable and unaffected by this method call. @param daysToAdd the days to add, may be negative @return a {@code LocalDate} based on this date with the days added, not null @throws DateTimeException if the result exceeds the supported date range
This datetime instance is immutable and unaffected by this method call.
The following three lines are identical in effect:
DateMidnight added = dt.plusDays(6); DateMidnight added = dt.plus(Period.days(6)); DateMidnight added = dt.withFieldAdded(DurationFieldType.days(), 6);@param days the amount of days to add, may be negative @return the new datetime plus the increased days @since 1.1
The calculation will do its best to only change the day field retaining the same time of day. However, in certain circumstances, typically daylight savings cutover, it may be necessary to alter the time fields.
In spring an hour is typically removed. If adding one day results in the time being within the cutover then the time is adjusted to be within summer time. For example, if the cutover is from 01:59 to 03:00 and the result of this method would have been 02:30, then the result will be adjusted to 03:30.
The following three lines are identical in effect:
DateTime added = dt.plusDays(6); DateTime added = dt.plus(Period.days(6)); DateTime added = dt.withFieldAdded(DurationFieldType.days(), 6);
This datetime instance is immutable and unaffected by this method call. @param days the amount of days to add, may be negative @return the new datetime plus the increased days @since 1.1
This LocalDate instance is immutable and unaffected by this method call.
The following three lines are identical in effect:
LocalDate added = dt.plusDays(6); LocalDate added = dt.plus(Period.days(6)); LocalDate added = dt.withFieldAdded(DurationFieldType.days(), 6);@param days the amount of days to add, may be negative @return the new LocalDate plus the increased days
This LocalDateTime instance is immutable and unaffected by this method call.
The following three lines are identical in effect:
LocalDateTime added = dt.plusDays(6); LocalDateTime added = dt.plus(Period.days(6)); LocalDateTime added = dt.withFieldAdded(DurationFieldType.days(), 6);@param days the amount of days to add, may be negative @return the new LocalDateTime plus the increased days
This period instance is immutable and unaffected by this method call. @param days the amount of days to add, may be negative @return the new period plus the increased days @throws UnsupportedOperationException if the field is not supported
This date instance is immutable and unaffected by this method call.
The following three lines are identical in effect:
YearMonthDay added = dt.plusDays(6); YearMonthDay added = dt.plus(Period.days(6)); YearMonthDay added = dt.withFieldAdded(DurationFieldType.days(), 6);@param days the amount of days to add, may be negative @return the new date plus the increased days @since 1.1
This method adds the specified amount to the days field incrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded.
For example, 2008-12-31 plus one day would result in 2009-01-01.
This instance is immutable and unaffected by this method call. @param daysToAdd the days to add, may be negative @return a {@code LocalDate} based on this date with the days added, not null @throws DateTimeException if the result exceeds the supported date range
This method adds the specified amount to the days field incrementing the month and year fields as necessary to ensure the result remains valid. The result is only invalid if the maximum/minimum year is exceeded.
For example, 2008-12-31 plus one day would result in 2009-01-01.
This instance is immutable and unaffected by this method call. @param days the days to add, may be negative @return a {@code LocalDateTime} based on this date-time with the days added, not null @throws DateTimeException if the result exceeds the supported date range
This operates on the local time-line, {@link LocalDateTime#plusDays(long) adding days} to the local date-time.This is then converted back to a {@code ZonedDateTime}, using the zone ID to obtain the offset.
When converting back to {@code ZonedDateTime}, if the local date-time is in an overlap, then the offset will be retained if possible, otherwise the earlier offset will be used. If in a gap, the local date-time will be adjusted forward by the length of the gap.
This instance is immutable and unaffected by this method call. @param days the days to add, may be negative @return a {@code ZonedDateTime} based on this date-time with the days added, not null @throws DateTimeException if the result exceeds the supported date range
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|