xref: /original-bsd/usr.bin/f77/libU77/itime_.c (revision 0b685140)
1 /*
2 char id_itime[] = "@(#)itime_.c	1.1";
3  *
4  * return the current time in numerical form
5  *
6  * calling sequence:
7  *	integer iarray(3)
8  *	call itime(iarray)
9  * where:
10  *	iarray will receive the current time; hour, min, sec.
11  */
12 
13 #include <sys/types.h>
14 #include <time.h>
15 
16 itime_(iar)
17 struct { long ihr; long imin; long isec; } *iar;
18 {
19 	struct tm *localtime(), *lclt;
20 	long int time(), t;
21 
22 	t = time(0);
23 	lclt = localtime(&t);
24 	iar->ihr = lclt->tm_hour;
25 	iar->imin = lclt->tm_min;
26 	iar->isec = lclt->tm_sec;
27 }
28