The short answer to your question might be demonstrated with code like this:
; Make up some start date and end date. Note the below method for getting
; time in IDL to be set in milliseconds since the "Epoch" (1/1/1970 00:00:00 GMT)
julBaseTime = long64(julday(1, 1, 1970, 0, 0, 0))
julStartTime = long64(julday(12,21,2006,0,0,0)) ; Julian date of 12/21/2006 in # Days
julEndTime = long64(julday(3,21,2007,0,0,0)) ; 3/21/2007
nMsecsPerDay = 60LL * 60 * 24 * 1000 ; Java Date( ) wants milliseconds
epochStartTime = (julStartTime - julBaseTime) * nMsecsPerDay
epochEndTime = (julEndTime - julBaseTime) * nMsecsPerDay
oJStartDate = obj_new('IDLJavaObject$JAVA_UTIL_DATE', $
'java.util.Date', epochStartTime)
oJEndDate = obj_new('IDLJavaObject$JAVA_UTIL_DATE', $
'java.util.Date', epochEndTime)
; Anyone can test these next two commands to see that the Date object passes fine
oJDTatProc = obj_new( $
'IDLJavaObject$' + $
'JAVAX_PRINT_ATTRIBUTE_STANDARD_DATETIMEATPROCESSING', $
'javax.print.attribute.standard.DateTimeAtProcessing', oJStartDate)
print, oJDTatProc->GetName()
; Now this next line is specific for Rohit's custom DateRange class
oJDateRange = obj_new('IDLJavaObject$DATERANGE, 'DateRange', $
oJStartDate, oJEndDate)James Jones
|