summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorAlex Riesen <raa.lkml@gmail.com>2009-08-31 02:26:05 (GMT)
committerJunio C Hamano <gitster@pobox.com>2009-08-31 02:59:11 (GMT)
commit33012fc429af24fee64f39406d401662feb947a8 (patch)
treeb74ad0a886fdc62a7123844db739d959cfc5edd8 /cache.h
parent36e4986f26d18defa51fd7af60ec7e7a98337902 (diff)
downloadgit-33012fc429af24fee64f39406d401662feb947a8.zip
git-33012fc429af24fee64f39406d401662feb947a8.tar.gz
git-33012fc429af24fee64f39406d401662feb947a8.tar.bz2
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 <raa.lkml@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index f793789..cd5aa89 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