The calculation will subtract 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 subtracting one hour from 03:30 will result in 01:30. This is a duration of one hour earlier, even though the hour field value changed from 3 to 1.
The following three lines are identical in effect:
DateTime subtracted = dt.minusHours(6); DateTime subtracted = dt.minus(Period.hours(6)); DateTime subtracted = dt.withFieldAdded(DurationFieldType.hours(), -6);
This datetime instance is immutable and unaffected by this method call. @param hours the amount of hours to subtract, may be negative @return the new datetime minus the increased hours @since 1.1
This time instance is immutable and unaffected by this method call.
The following three lines are identical in effect:
TimeOfDay subtracted = dt.minusHours(6); TimeOfDay subtracted = dt.minus(Period.hours(6)); TimeOfDay subtracted = dt.withFieldAdded(DurationFieldType.hours(), -6);@param hours the amount of hours to subtract, may be negative @return the new time minus the increased hours @since 1.1
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|