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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
a5481a6c94
commit
aa1462cc3d
5
strbuf.h
5
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.
|
||||
*
|
||||
|
Reference in New Issue
Block a user