From 148fb9622c6a96021e572d1a372e38896506031f Mon Sep 17 00:00:00 2001 From: Lars Hjemli Date: Sat, 16 Dec 2006 00:33:28 +0100 Subject: Move cgit_print_date into ui-shared, reuse in ui-summary Signed-off-by: Lars Hjemli --- ui-shared.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index cb8a8df..1a6c127 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -60,6 +60,18 @@ char *cgit_pageurl(const char *reponame, const char *pagename, } } + +void cgit_print_date(unsigned long secs) +{ + char buf[32]; + struct tm *time; + + time = gmtime(&secs); + strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", time); + html_txt(buf); + +} + void cgit_print_docstart(char *title, struct cacheitem *item) { html("Content-Type: text/html; charset=utf-8\n"); -- cgit v1.2.3-59-g8ed1b