aboutsummaryrefslogtreecommitdiff
path: root/t/t0006-date.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2016-07-22 15:51:49 -0400
committerJunio C Hamano <gitster@pobox.com>2016-07-27 14:15:51 -0700
commit642833db78aa5d7a72677aa9a9b013fb9a880f19 (patch)
tree78867445ed1858ddfe222521fbeba775c9d545e2 /t/t0006-date.sh
parent1a2a1e8eb93de2b89a32a52980ec7614fe9d154c (diff)
downloadgit-642833db78aa5d7a72677aa9a9b013fb9a880f19.tar.gz
git-642833db78aa5d7a72677aa9a9b013fb9a880f19.tar.xz
date: add "unix" format
We already have "--date=raw", which is a Unix epoch timestamp plus a contextual timezone (either the author's or the local). But one may not care about the timezone and just want the epoch timestamp by itself. It's not hard to parse the two apart, but if you are using a pretty-print format, you may want git to show the "finished" form that the user will see. We can accomodate this by adding a new date format, "unix", which is basically "raw" without the timezone. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0006-date.sh')
-rwxr-xr-xt/t0006-date.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t0006-date.sh b/t/t0006-date.sh
index 482fec0d7..c0c910867 100755
--- a/t/t0006-date.sh
+++ b/t/t0006-date.sh
@@ -46,8 +46,10 @@ check_show rfc2822 "$TIME" 'Wed, 15 Jun 2016 16:13:20 +0200'
check_show short "$TIME" '2016-06-15'
check_show default "$TIME" 'Wed Jun 15 16:13:20 2016 +0200'
check_show raw "$TIME" '1466000000 +0200'
+check_show unix "$TIME" '1466000000'
check_show iso-local "$TIME" '2016-06-15 14:13:20 +0000'
check_show raw-local "$TIME" '1466000000 +0000'
+check_show unix-local "$TIME" '1466000000'
# arbitrary time absurdly far in the future
FUTURE="5758122296 -0400"