diff options
author | Robin Rosenberg <robin.rosenberg@dewire.com> | 2007-07-14 01:00:42 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2007-07-13 22:47:49 -0700 |
commit | ee8f838e0346751b21250f8d107049829b855a98 (patch) | |
tree | 1c64640d85fff10072e4e57eff1cedd3c4dc13aa /date.c | |
parent | Merge branch 'master' of git://git.kernel.org/pub/scm/gitk/gitk (diff) | |
download | tgif-ee8f838e0346751b21250f8d107049829b855a98.tar.xz |
Support output ISO 8601 format dates
Support output of full ISO 8601 style dates in e.g. git log
and other places that use interpolation for formatting.
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'date.c')
-rw-r--r-- | date.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -137,6 +137,13 @@ const char *show_date(unsigned long time, int tz, enum date_mode mode) if (mode == DATE_SHORT) sprintf(timebuf, "%04d-%02d-%02d", tm->tm_year + 1900, tm->tm_mon + 1, tm->tm_mday); + else if (mode == DATE_ISO8601) + sprintf(timebuf, "%04d-%02d-%02d %02d:%02d:%02d %+05d", + tm->tm_year + 1900, + tm->tm_mon + 1, + tm->tm_mday, + tm->tm_hour, tm->tm_min, tm->tm_sec, + tz); else sprintf(timebuf, "%.3s %.3s %d %02d:%02d:%02d %d%c%+05d", weekday_names[tm->tm_wday], |