1 2C*GRDATE -- get date and time as character string (Mac) 3C+ 4 SUBROUTINE GRDATE(STRING, L) 5 CHARACTER*(*) STRING 6 INTEGER L 7C 8C Return the current date and time, in format 'dd-Mmm-yyyy hh:mm'. 9C To receive the whole string, the STRING should be declared 10C CHARACTER*17. 11C 12C Arguments: 13C STRING : receives date and time, truncated or extended with 14C blanks as necessary. 15C L : receives the number of characters in STRING, excluding 16C trailing blanks. This will always be 17, unless the length 17C of the string supplied is shorter. 18C-- 19C 19-Jan-1988 20C 21-Jan-1995 Modified to work on mac with MPW Fortran 2.1 21C----------------------------------------------------------------------- 22 Character CDate*9, CTime*8 23C 24C The Date subroutine returns the current date in this form: DD-MMM-yy. 25C So we if yy is between 00 and 50, we assume that the first two digits are 20. 26C if yy is between 51 to 99, we assume that the first two digits are 19. 27C The Time subroutine returns the current time in this form: HH:MM:SS 28 29 Call Date(CDate) 30 Call Time(CTime) 31 If ((CDate(8:9) .ge. '00') .and. (CDate(8:9) .le. '50')) Then 32 String = CDate(1:7)//'20'//CDate(8:9)//' '//CTime(1:5) 33 Else 34 String = CDate(1:7)//'19'//CDate(8:9)//' '//CTime(1:5) 35 End If 36 L = MIN(17,LEN(STRING)) 37 Return 38 END 39