public static DateValue add ( DateValue date , DateValue duration ) { DTBuilder db = new DTBuilder ( date ) ; db . year += duration . year ( ) ; db . month += duration . month ( ) ; db . day += duration . day ( ) ; if ( duration instanceof TimeValue ) { TimeValue tdur = ( TimeValue ) duration ; db . hour += tdur . hour ( ) ; db . minute += tdur . minute ( ) ; db . second += tdur . second ( ) ; return db . toDateTime ( ) ; } return ( date instanceof TimeValue ) ? db . toDateTime ( ) : db . toDate ( ) ; }
Adds a duration to a date .