The calculation will add a duration equivalent to the number of hours expressed in milliseconds.
For example, if a spring daylight savings cutover is from 01:59 to 03:00 then adding one hour to 01:30 will result in 03:30. This is a duration of one hour later, even though the hour field value changed from 1 to 3.
The following three lines are identical in effect:
DateTime added = dt.plusHours(6); DateTime added = dt.plus(Period.hours(6)); DateTime added = dt.withFieldAdded(DurationFieldType.hours(), 6);
This datetime instance is immutable and unaffected by this method call. @param hours the amount of hours to add, may be negative @return the new datetime plus the increased hours @since 1.1
This LocalDateTime instance is immutable and unaffected by this method call.
The following three lines are identical in effect:
LocalDateTime added = dt.plusHours(6); LocalDateTime added = dt.plus(Period.hours(6)); LocalDateTime added = dt.withFieldAdded(DurationFieldType.hours(), 6);@param hours the amount of hours to add, may be negative @return the new LocalDateTime plus the increased hours
This period instance is immutable and unaffected by this method call. @param hours the amount of hours to add, may be negative @return the new period plus the increased hours @throws UnsupportedOperationException if the field is not supported
This adds the specified number of hours to this time, returning a new time. The calculation wraps around midnight.
This instance is immutable and unaffected by this method call. @param hours the hours to add, may be negative @return an {@code OffsetTime} based on this time with the hours added, not null
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|