Commit | Line | Data |
---|---|---|
1bf51f40 | 1 | /* |
161423a6 RE |
2 | * Copyright (c) 1980 Regents of the University of California. |
3 | * All rights reserved. The Berkeley software License Agreement | |
4 | * specifies the terms and conditions for redistribution. | |
1bf51f40 | 5 | * |
95f51977 | 6 | * @(#)itime_.c 5.1 6/7/85 |
161423a6 RE |
7 | */ |
8 | ||
9 | /* | |
1bf51f40 DW |
10 | * return the current time in numerical form |
11 | * | |
12 | * calling sequence: | |
13 | * integer iarray(3) | |
14 | * call itime(iarray) | |
15 | * where: | |
16 | * iarray will receive the current time; hour, min, sec. | |
17 | */ | |
18 | ||
19 | #include <sys/types.h> | |
aa10b8fc | 20 | #include <sys/time.h> |
1bf51f40 DW |
21 | |
22 | itime_(iar) | |
23 | struct { long ihr; long imin; long isec; } *iar; | |
24 | { | |
25 | struct tm *localtime(), *lclt; | |
26 | long int time(), t; | |
27 | ||
28 | t = time(0); | |
29 | lclt = localtime(&t); | |
30 | iar->ihr = lclt->tm_hour; | |
31 | iar->imin = lclt->tm_min; | |
32 | iar->isec = lclt->tm_sec; | |
33 | } |