xref: /csrg-svn/usr.bin/f77/libU77/itime_.c (revision 47944)
1*47944Sbostic /*-
2*47944Sbostic  * Copyright (c) 1980 The Regents of the University of California.
3*47944Sbostic  * All rights reserved.
42399Sdlw  *
5*47944Sbostic  * %sccs.include.proprietary.c%
623033Skre  */
723033Skre 
8*47944Sbostic #ifndef lint
9*47944Sbostic static char sccsid[] = "@(#)itime_.c	5.2 (Berkeley) 04/12/91";
10*47944Sbostic #endif /* not lint */
11*47944Sbostic 
1223033Skre /*
132399Sdlw  * return the current time in numerical form
142399Sdlw  *
152399Sdlw  * calling sequence:
162399Sdlw  *	integer iarray(3)
172399Sdlw  *	call itime(iarray)
182399Sdlw  * where:
192399Sdlw  *	iarray will receive the current time; hour, min, sec.
202399Sdlw  */
212399Sdlw 
222399Sdlw #include <sys/types.h>
2313584Swnj #include <sys/time.h>
242399Sdlw 
252399Sdlw itime_(iar)
262399Sdlw struct { long ihr; long imin; long isec; } *iar;
272399Sdlw {
282399Sdlw 	struct tm *localtime(), *lclt;
292399Sdlw 	long int time(), t;
302399Sdlw 
312399Sdlw 	t = time(0);
322399Sdlw 	lclt = localtime(&t);
332399Sdlw 	iar->ihr = lclt->tm_hour;
342399Sdlw 	iar->imin = lclt->tm_min;
352399Sdlw 	iar->isec = lclt->tm_sec;
362399Sdlw }
37