Commit | Line | Data |
---|---|---|
306ab507 DW |
1 | /* |
2 | char id_idate[] = "@(#)idate_.c 1.1"; | |
3 | * | |
4 | * return date in numerical form | |
5 | * | |
6 | * calling sequence: | |
7 | * integer iarray(3) | |
8 | * call idate(iarray) | |
9 | * where: | |
10 | * iarray will receive the current date; day, mon, year. | |
11 | */ | |
12 | ||
13 | #include <sys/types.h> | |
14 | #include <time.h> | |
15 | ||
16 | idate_(iar) | |
17 | struct { long iday; long imon; long iyer; } *iar; | |
18 | { | |
19 | struct tm *localtime(), *lclt; | |
20 | long int time(), t; | |
21 | ||
22 | t = time(0); | |
23 | lclt = localtime(&t); | |
24 | iar->iday = lclt->tm_mday; | |
25 | iar->imon = lclt->tm_mon + 1; | |
26 | iar->iyer = lclt->tm_year + 1900; | |
27 | } |