Mercurial > paster
diff util.c @ 5:f455893bf0b0
pasterd: show dates in /
author | David Demelier <markand@malikania.fr> |
---|---|
date | Wed, 05 Feb 2020 13:15:55 +0100 |
parents | 836a698946f8 |
children | 07b6887d3557 |
line wrap: on
line diff
--- a/util.c Wed Feb 05 20:10:00 2020 +0100 +++ b/util.c Wed Feb 05 13:15:55 2020 +0100 @@ -23,6 +23,7 @@ #include <stdlib.h> #include <stdnoreturn.h> #include <string.h> +#include <time.h> #include "util.h" @@ -64,3 +65,13 @@ return buf; } + +const char * +bstrftime(const char *fmt, const struct tm *tm) +{ + static char buf[BUFSIZ]; + + strftime(buf, sizeof (buf), fmt, tm); + + return buf; +}