diff options
author | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-12-14 17:09:14 +0100 |
---|---|---|
committer | cinap_lenrek <cinap_lenrek@felloff.net> | 2019-12-14 17:09:14 +0100 |
commit | c3af90c6c7441c41dc592d0b94023895859634fa (patch) | |
tree | 323e74bd519d735af1a46b05478854796a07d547 /sys/src/cmd/date.c | |
parent | 685670b0ddb9eb8398d88cbae1b08a2872b5adf6 (diff) |
date: make ISO 8601 time output compatible to RFC3339
RFC3339 is a stricter subset of ISO 8601, in particular
the timezone offset needs to be specified as +HH:MM while
in ISO 8601 the colon is optional.
Diffstat (limited to 'sys/src/cmd/date.c')
-rw-r--r-- | sys/src/cmd/date.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/src/cmd/date.c b/sys/src/cmd/date.c index 21363dfee..72ab6d83b 100644 --- a/sys/src/cmd/date.c +++ b/sys/src/cmd/date.c @@ -15,7 +15,7 @@ int uflg, nflg, iflg, tflg, mflg; char* isodate(Tm *t) { - static char c[25]; /* leave room to append isotime */ + static char c[26]; /* leave room to append isotime */ snprint(c, 11, "%04d-%02d-%02d", t->year + 1900, t->mon + 1, t->mday); return c; @@ -39,7 +39,7 @@ isotime(Tm *t) c[9] = '-'; tz = -tz; } - snprint(c+10, 5, "%02d%02d", tz / 60, tz % 60); + snprint(c+10, 6, "%02d:%02d", tz / 60, tz % 60); } else { c[9] = 'Z'; c[10] = 0; |