summaryrefslogtreecommitdiff
path: root/lib/libc/stdtime/strftime.c
diff options
context:
space:
mode:
authorJoerg Wunsch <joerg@FreeBSD.org>2000-01-28 17:40:42 +0000
committerJoerg Wunsch <joerg@FreeBSD.org>2000-01-28 17:40:42 +0000
commit208b5822011b66b1bb7c645c9c9b989c34bcdf30 (patch)
tree71db919cf3092722ff398889aac77019702b7188 /lib/libc/stdtime/strftime.c
parentee51b2c45fa352dca02b88b9e1f485e9dadc6b55 (diff)
Notes
Diffstat (limited to 'lib/libc/stdtime/strftime.c')
-rw-r--r--lib/libc/stdtime/strftime.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/lib/libc/stdtime/strftime.c b/lib/libc/stdtime/strftime.c
index 9aa891f6e168..6404d9c4f26f 100644
--- a/lib/libc/stdtime/strftime.c
+++ b/lib/libc/stdtime/strftime.c
@@ -397,6 +397,22 @@ label:
pt, ptlim);
} else pt = _add("?", pt, ptlim);
continue;
+ case 'z':
+ {
+ long absoff;
+ if (t->tm_gmtoff >= 0) {
+ absoff = t->tm_gmtoff;
+ pt = _add("+", pt, ptlim);
+ } else {
+ absoff = -t->tm_gmtoff;
+ pt = _add("-", pt, ptlim);
+ }
+ pt = _conv(absoff / 3600, "%02d",
+ pt, ptlim);
+ pt = _conv((absoff % 3600) / 60, "%02d",
+ pt, ptlim);
+ };
+ continue;
case '+':
pt = _fmt(Locale->date_fmt, t, pt, ptlim);
continue;