Commit | Line | Data |
---|---|---|
1bf51f40 | 1 | /* |
aa10b8fc | 2 | char id_itime[] = "@(#)itime_.c 1.2"; |
1bf51f40 DW |
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> | |
aa10b8fc | 14 | #include <sys/time.h> |
1bf51f40 DW |
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 | } |