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
|
|
|
|