1 /*$Id$*/ 2 #include <sys/types.h> 3 #include <time.h> 4 #if !defined(IPSC) && !defined(WIN32) 5 #include <sys/time.h> 6 #endif 7 8 #if defined(CRAY) && !defined(__crayx1) 9 #define util_date_ UTIL_DATE 10 #include <fortran.h> 11 #define FATR 12 #endif 13 #if defined(WIN32) &&!defined(__MINGW32__) 14 #define util_date_ UTIL_DATE 15 #include "typesf2c.h" 16 #endif 17 18 #if defined(USE_FCD) 19 int string_to_fortchar(_fcd, int, const char *); 20 #else 21 int string_to_fortchar(char *, int, const char *); 22 #endif 23 24 /* 25 Routine to return to FORTRAN the current date in 26 same format as the C routine ctime. 27 28 character*(*) date 29 call util_date(date) 30 */ 31 32 33 #if defined(USE_FCD) util_date_(_fcd date)34void FATR util_date_(_fcd date) 35 { 36 int nlen = _fcdlen(date); 37 #else 38 void util_date_(char *date, int nlen) 39 { 40 #endif 41 time_t t = time((time_t *) 0); 42 char *tmp = ctime(&t); 43 44 (void) string_to_fortchar(date, nlen, tmp); 45 } 46