From 33012fc429af24fee64f39406d401662feb947a8 Mon Sep 17 00:00:00 2001 From: Alex Riesen Date: Sun, 30 Aug 2009 22:26:05 -0400 Subject: Add date formatting and parsing functions relative to a given time The main purpose is to allow predictable testing of the code. Signed-off-by: Alex Riesen Signed-off-by: Jeff King Signed-off-by: Junio C Hamano --- cache.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'cache.h') diff --git a/cache.h b/cache.h index f79378937..cd5aa89ca 100644 --- a/cache.h +++ b/cache.h @@ -731,9 +731,14 @@ enum date_mode { }; const char *show_date(unsigned long time, int timezone, enum date_mode mode); +const char *show_date_relative(unsigned long time, int tz, + const struct timeval *now, + char *timebuf, + size_t timebuf_size); int parse_date(const char *date, char *buf, int bufsize); void datestamp(char *buf, int bufsize); unsigned long approxidate(const char *); +unsigned long approxidate_relative(const char *date, const struct timeval *now); enum date_mode parse_date_format(const char *format); #define IDENT_WARN_ON_NO_NAME 1 -- cgit v1.2.1