5 #include "fprintftime.h"
6 #include "parse-datetime.h"
11 /* Display the date and/or time in WHEN according to the format specified
12 in FORMAT, followed by a newline.
14 If successful, return true.
15 If unsuccessful, prints an error message to STDERR and returns false.
16 If unsuccessful and ON_ERROR_PRINT_UNFORMATTED, also prints WHEN.TV_SEC
20 show_date (char const *format
, struct timespec when
, timezone_t tz
)
24 if (localtime_rz (tz
, &when
.tv_sec
, &tm
))
26 fprintftime (stdout
, format
, &tm
, tz
, when
.tv_nsec
);
31 char buf
[INT_BUFSIZE_BOUND (intmax_t)];
32 error (0, 0, _("time %s is out of range"),
33 quote (timetostr (when
.tv_sec
, buf
)));