summaryrefslogtreecommitdiff
path: root/stagit-index.c
diff options
context:
space:
mode:
authorHiltjo Posthuma <hiltjo@codemadness.org>2016-05-01 16:10:17 +0200
committerHiltjo Posthuma <hiltjo@codemadness.org>2016-05-01 16:56:58 +0200
commit462ba66ee7e0ae16f41d4fff9c8540913c3941a9 (patch)
tree52e9a091d70fa7e885a69b365f803cbd3bf61597 /stagit-index.c
parent7a1da0b9853093781dd1b130d63619b17ecc8c01 (diff)
fix times (and timezone)
- in the index and log show the short time (GMT). - in the Atom feed use GMT time. - for commits show the time + offset.
Diffstat (limited to 'stagit-index.c')
-rw-r--r--stagit-index.c12
1 files changed, 3 insertions, 9 deletions
diff --git a/stagit-index.c b/stagit-index.c
index 2d7bf85..1d26e0f 100644
--- a/stagit-index.c
+++ b/stagit-index.c
@@ -42,25 +42,19 @@ xmlencode(FILE *fp, const char *s, size_t len)
}
void
-printtimeformat(FILE *fp, const git_time *intime, const char *fmt)
+printtimeshort(FILE *fp, const git_time *intime)
{
struct tm *intm;
time_t t;
char out[32];
- t = (time_t) intime->time + (intime->offset * 60);
+ t = (time_t)intime->time;
if (!(intm = gmtime(&t)))
return;
- strftime(out, sizeof(out), fmt, intm);
+ strftime(out, sizeof(out), "%Y-%m-%d %H:%M", intm);
fputs(out, fp);
}
-void
-printtimeshort(FILE *fp, const git_time *intime)
-{
- printtimeformat(fp, intime, "%Y-%m-%d %H:%M");
-}
-
int
writeheader(FILE *fp)
{