1 /*- 2 * Copyright (c) 1980 The Regents of the University of California. 3 * All rights reserved. 4 * 5 * %sccs.include.proprietary.c% 6 */ 7 8 #ifndef lint 9 static char sccsid[] = "@(#)itime_.c 5.2 (Berkeley) 04/12/91"; 10 #endif /* not lint */ 11 12 /* 13 * return the current time in numerical form 14 * 15 * calling sequence: 16 * integer iarray(3) 17 * call itime(iarray) 18 * where: 19 * iarray will receive the current time; hour, min, sec. 20 */ 21 22 #include <sys/types.h> 23 #include <sys/time.h> 24 25 itime_(iar) 26 struct { long ihr; long imin; long isec; } *iar; 27 { 28 struct tm *localtime(), *lclt; 29 long int time(), t; 30 31 t = time(0); 32 lclt = localtime(&t); 33 iar->ihr = lclt->tm_hour; 34 iar->imin = lclt->tm_min; 35 iar->isec = lclt->tm_sec; 36 } 37