2 * humandate.c - convert an NTP (or the current) time to something readable
8 #include "ntp_unixtime.h" /* includes <sys/time.h> and <time.h> */
9 #include "lib_strbuf.h"
10 #include "ntp_stdlib.h"
13 /* This is used in msyslog.c; we don't want to clutter up the log with
14 the year and day of the week, etc.; just the minimal date and time. */
24 tm = localtime(&cursec);
26 return "-- --- --:--:--";
30 snprintf(bp, LIB_BUFLENGTH, "%2d %s %02d:%02d:%02d",
31 tm->tm_mday, months[tm->tm_mon],
32 tm->tm_hour, tm->tm_min, tm->tm_sec);
39 * humantime() -- like humanlogtime() but without date, and with the
40 * time to display given as an argument.
50 tm = localtime(&cursec);
56 snprintf(bp, LIB_BUFLENGTH, "%02d:%02d:%02d",
57 tm->tm_hour, tm->tm_min, tm->tm_sec);