-
-
-
-/*
- * Format a date/time stamp for output
- * seconds is whether to print the seconds
- */
-void fmt_date(char *buf, size_t n, time_t thetime, int seconds) {
- struct tm tm;
- char *teh_format = NULL;
-
- *buf = '\0';
- localtime_r(&thetime, &tm);
-
- if (seconds) {
- teh_format = "%F %R:%S";
- }
- else {
- teh_format = "%F %R";
- }
-
- strftime(buf, n, teh_format, &tm);
-}
-
-
-