From aa1462cc3d3b0c4c8ad6a60aaf31e0f3a424162d Mon Sep 17 00:00:00 2001 From: Jeff King Date: Thu, 25 Jun 2015 12:55:45 -0400 Subject: introduce "format" date-mode This feeds the format directly to strftime. Besides being a little more flexible, the main advantage is that your system strftime may know more about your locale's preferred format (e.g., how to spell the days of the week). Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- strbuf.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'strbuf.h') diff --git a/strbuf.h b/strbuf.h index 01c5c6371..8c8f8d56f 100644 --- a/strbuf.h +++ b/strbuf.h @@ -344,6 +344,11 @@ extern void strbuf_commented_addf(struct strbuf *sb, const char *fmt, ...); __attribute__((format (printf,2,0))) extern void strbuf_vaddf(struct strbuf *sb, const char *fmt, va_list ap); +/** + * Add the time specified by `tm`, as formatted by `strftime`. + */ +extern void strbuf_addftime(struct strbuf *sb, const char *fmt, const struct tm *tm); + /** * Read a given size of data from a FILE* pointer to the buffer. * -- cgit v1.2.1