This will allow this code to be common with print_rel_date.
Signed-off-by: John Keeping <john@keeping.me.uk>
-void cgit_print_date(time_t secs, const char *format, int local_time)
+static const char *fmt_date(time_t secs, const char *format, int local_time)
struct tm *time;
if (!secs)
struct tm *time;
if (!secs)
if (local_time)
time = localtime(&secs);
else
time = gmtime(&secs);
strftime(buf, sizeof(buf)-1, format, time);
if (local_time)
time = localtime(&secs);
else
time = gmtime(&secs);
strftime(buf, sizeof(buf)-1, format, time);
+ return buf;
+}
+
+void cgit_print_date(time_t secs, const char *format, int local_time)
+{
+ html_txt(fmt_date(secs, format, local_time));
}
static void print_rel_date(time_t t, double value,
}
static void print_rel_date(time_t t, double value,