'\" .TH DATE_AND_TIME 3F "98/09/16" .SH NAME \f3date_and_time\f1 \- Returns date and time in character form .SH SYNOPSIS .B subroutine date_and_time (date, time, zone, values) .br .B character*8 date .br .B character*10 time .br .B character*5 zone .br .B integer*4 values(8) .SH DESCRIPTION This is a Fortran 77 version of the Fortran 90 routine .B DATE_AND_TIME and is .B "YEAR 2000 SAFE." .PP The \f3DATE_AND_TIME\f1 subroutine returns data from the \%real-time clock and the date. Local time is returned, as well as the difference between local time and Universal Coordinated Time (UTC) (also known as Greenwich Mean Time, GMT). .PP The \f3DATE_AND_TIME\f1 subroutine accepts the following arguments: .TP 10 \f2date\f1 Must be a scalar of type character. It must be at least 8 characters long to contain the complete value. It is an output argument, and the leftmost 8 characters are set to a value of the form \f2CCYYMMDD\f1, where \f2CC\f1 is the century, \f2YY\f1 is the year within the century, \f2MM\f1 is the month within the year, and \f2DD\f1 is the day within the month. If there is no date available, \f2date\f1 is set to blanks. .TP 10 \f2time\f1 Must be a scalar of type character. It must be at least 10 characters long to contain the complete value. It is an output argument, and the leftmost 10 characters are set to a value of the form \f2hhmmss.sss\f1, where \f2hh\f1 is the hour of the day, \f2mm\f1 is the minutes of the hour, and \f2ss.sss\f1 is seconds and milliseconds of the minute. If there is no clock available, \f2time\f1 is set to blanks. .TP 10 \f2zone\f1 Must be a scalar of type character. It must be at least 5 characters long to contain the complete value. It is an output argument whose leftmost 5 characters are set to a value of the form \%\f2\(+-hhmm\f1, where \f2hh\f1 and \f2mm\f1 are the time difference with respect to UTC in hours and parts of an hour expressed in minutes, respectively. If there is no clock available, \f2zone\f1 is set to blanks. (\f2Note:\f1 Local time zone is set by the operating system and/or the \f3TZ\f1 environment variable.) .TP 10 \f2values\f1 Must be of type default integer and of rank one. It is an output argument and must have at least 8 elements. The values returned in \f2values\f1 are as follows: .RS 10 .TP 10 \fBValues\f1 \fBReturn value\f1 .TP \f2values\f3(1) The year (that is, \f31990\f1) .TP \f2values\f3(2) The month of the year \%(\f31\f1-\f312\f1) .TP \f2values\f3(3) The day of the month \%(\f31\f1-\f331\f1) .TP \f2values\f3(4) The time difference, in minutes, with respect to UTC .TP \f2values\f3(5) The hour of the day, in the range of \f30\f1 to \f323\f1 .TP \f2values\f3(6) The minutes of the hour, in the range \f30\f1 to \f359\f1 .TP \f2values\f3(7) The seconds of the minute, in the range \f30\f1 to \f360\f1 .TP \f2values\f3(8) The milliseconds of the second, in the range \f30\f1 to \f3999\f1 .RE .SH EXAMPLES .sp .ft 3 .nf integer*4 date_time(8) character(len=10) big_ben(3) call date_and_time(big_ben(1), big_ben(2), big_ben(3), date_time) print *,'date_time array values:' print *,'year=',date_time(1) print *,'month_of_year=',date_time(2) print *,'day_of_month=',date_time(3) print *,'time difference in minutes=',date_time(4) print *,'hour of day=',date_time(5) print *,'minutes of hour=',date_time(6) print *,'seconds of minute=',date_time(7) print *,'milliseconds of second=',date_time(8) print *, 'DATE=',big_ben(1) print *, 'TIME=',big_ben(2) print *, 'ZONE=',big_ben(3) end .ft 1 .fi .PP When this program was run in California, USA, on October 10, 1997, it generated the following output: .sp .ft 3 .ne 1i .nf date_time array values: year= 1997 month_of_year= 10 day_of_month= 10 time difference in minutes= -420 hour of day= 16 minutes of hour= 35 seconds of minute= 37 milliseconds of second= 708 DATE=19971010 TIME=163537.708 ZONE=-0700 .ft 1 .fi .SH FILES .B libF77.a .SH "SEE ALSO" .BR idate (3f), .BR ctime (3F), .BR fdate (3F), and the .I "FORTRAN 77 Language Reference Manual"