public static String TI_ITOC ( int [ ] idtarr ) { String dattim ; String date , time ; // Put array values into variables. int iyear = idtarr [ 0 ] ; int imonth = idtarr [ 1 ] ; int iday = idtarr [ 2 ] ; int ihour = idtarr [ 3 ] ; int iminut = idtarr [ 4 ] ; // Check for leap year. //int ndays = TI_DAYM(iyear, imonth); iyear = iyear % 100 ; // Check that each of these values is valid. /* TODO: Check these IF ( iyear .lt. 0 ) iret = -7 IF ( ( imonth .lt. 1 ) .or. ( imonth .gt. 12 ) ) iret = -8 IF ( ( iday .lt. 1 ) .or. ( iday .gt. ndays ) ) + iret = -9 IF ( ( ihour .lt. 0 ) .or. ( ihour .gt. 24 ) ) iret = -10 IF ( ( iminut .lt. 0 ) .or. ( iminut .gt. 60 ) ) iret = -11 IF ( iret .ne. 0 ) RETURN */ // Get the date and time. int idate = iyear * 10000 + imonth * 100 + iday ; int itime = ihour * 100 + iminut ; // Convert date and time to character strings. // Fill in blanks with zeroes. date = StringUtil2 . padZero ( idate , 6 ) ; time = StringUtil2 . padZero ( itime , 4 ) ; dattim = date + "/" + time ; return dattim ; }
This subroutine converts an integer time array into a standard GEMPAK time . The integers are checked for validity .