public long set ( long instant , int value ) { // lenient needs to handle time zone chronologies // so we do the calculation using local milliseconds long localInstant = iBase . getZone ( ) . convertUTCToLocal ( instant ) ; long difference = FieldUtils . safeSubtract ( value , get ( instant ) ) ; localInstant = getType ( ) . getField ( iBase . withUTC ( ) ) . add ( localInstant , difference ) ; return iBase . getZone ( ) . convertLocalToUTC ( localInstant , false , instant ) ; }
Set values which may be out of bounds by adding the difference between the new value and the current value .