#include void fdate (char *utime, long int k) { /* Loads *utime with the Unix format time/date string */ /* padded on the right with spaces. The argument list */ /* is suitable for calling from fortran and uses the */ /* hidden argument for the fortran string length. The */ /* calling sequence is */ /* CHARACTER*24 STR */ /* CALL FDATE(STR) */ /* */ /* If the string length of utime is too short for the */ /* date string, the latter will be truncated. */ /* JWD 11-Apr-91 */ char tbfr[26]; char *tp; long int i; time_t timeval; tp=utime; for(i=1;i<=k;i++){*utime=' ';utime++;} utime=tp; timeval = time((time_t*)NULL); strcpy(tbfr,ctime(&timeval)); tp=&tbfr[0]; i=0; while( ((int)(*tp) != 10) && (i < k) ){*utime=*tp;tp++;utime++;i++;} }