commit deb822c63f0298af256d313754b7d81bec708ab5
parent 0ae5c64c78291d0db0650680a93635311fd07f4a
Author: maydayv7 <maydayv7@gmail.com>
Date: Sat, 3 Jan 2026 12:08:32 +0530
feat: Use local system timezone
Diffstat:
3 files changed, 5 insertions(+), 4 deletions(-)
diff --git a/README.md b/README.md
@@ -14,6 +14,7 @@ This is my personal [fork](https://git.codemadness.org/stagit/) of `stagit`.
- Added [md4c](https://github.com/mity/md4c) to parse Markdown files
- Added [Chroma](https://github.com/alecthomas/chroma) for code syntax highlighting
- Sort repositories by last commit time on `index` page
+- Use local system timezone
## Usage
diff --git a/stagit-index.c b/stagit-index.c
@@ -90,7 +90,7 @@ void printtimeshort(FILE *fp, const git_time *intime) {
char out[32];
t = (time_t)intime->time;
- if (!(intm = gmtime(&t)))
+ if (!(intm = localtime(&t)))
return;
strftime(out, sizeof(out), "%Y-%m-%d %H:%M", intm);
fputs(out, fp);
diff --git a/stagit.c b/stagit.c
@@ -459,7 +459,7 @@ void printtimez(FILE *fp, const git_time *intime) {
char out[32];
t = (time_t)intime->time;
- if (!(intm = gmtime(&t)))
+ if (!(intm = localtime(&t)))
return;
strftime(out, sizeof(out), "%Y-%m-%dT%H:%M:%SZ", intm);
fputs(out, fp);
@@ -471,7 +471,7 @@ void printtime(FILE *fp, const git_time *intime) {
char out[32];
t = (time_t)intime->time + (intime->offset * 60);
- if (!(intm = gmtime(&t)))
+ if (!(intm = localtime(&t)))
return;
strftime(out, sizeof(out), "%a, %e %b %Y %H:%M:%S", intm);
if (intime->offset < 0)
@@ -487,7 +487,7 @@ void printtimeshort(FILE *fp, const git_time *intime) {
char out[32];
t = (time_t)intime->time;
- if (!(intm = gmtime(&t)))
+ if (!(intm = localtime(&t)))
return;
strftime(out, sizeof(out), "%Y-%m-%d %H:%M", intm);
fputs(out, fp);