1: /*
2: * Remote date and time.
3: *
4: * Usage: timex machine1 ... machineN
5: */
6: #include <stdio.h>
7: #include "Time.h"
8:
9: main(argc, argv)
10: int argc;
11: char **argv;
12: {
13: char *machine;
14: Time time;
15:
16: while (--argc > 0) {
17: machine = *++argv;
18: printf("%s:\n", machine);
19: time = LocalTime(machine);
20: display(&time, "Local time");
21: time = GMTime(machine);
22: display(&time, "GMT");
23: }
24: }
25:
26: display(tp, msg)
27: Time *tp;
28: char *msg;
29: {
30: printf("%s: %d:%02d:%02d %d/%d/%d\n",
31: msg, tp->tm_hour, tp->tm_min, tp->tm_sec,
32: tp->tm_mon + 1, tp->tm_mday, tp->tm_year);
33: }
Defined functions
main
defined in line
9;
never used