public void setValue ( Date theValue , TemporalPrecisionEnum thePrecision ) throws DataFormatException { if ( getTimeZone ( ) == null ) { setTimeZone ( TimeZone . getDefault ( ) ) ; } myPrecision = thePrecision ; myFractionalSeconds = "" ; if ( theValue != null ) { long millis = theValue . getTime ( ) % 1000 ; if ( millis < 0 ) { // This is for times before 1970 (see bug #444) millis = 1000 + millis ; } String fractionalSeconds = Integer . toString ( ( int ) millis ) ; myFractionalSeconds = StringUtils . leftPad ( fractionalSeconds , 3 , ' ' ) ; } super . setValue ( theValue ) ; }
Sets the value for this type using the given Java Date object as the time and using the specified precision as well as the local timezone as determined by the local operating system . Both of these properties may be modified in subsequent calls if neccesary .