From 25e9d1cb2d4fd2908b48640997e0922888ec5d8e Mon Sep 17 00:00:00 2001 From: Sebastian Harl Date: Thu, 15 Nov 2012 15:14:10 +0100 Subject: [PATCH] utils_time: cdtime_to_iso8601(): Include timezone information as well. --- src/utils_time.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils_time.c b/src/utils_time.c index f30dc0fa..6789758d 100644 --- a/src/utils_time.c +++ b/src/utils_time.c @@ -87,6 +87,11 @@ size_t cdtime_to_iso8601 (char *s, size_t max, cdtime_t t) /* {{{ */ len += (n < max - len) ? n : max - len; } + if (max - len > 3) { + int n = strftime (s + len, max - len, "%z", &t_tm); + len += (n < max - len) ? n : max - len; + } + s[max - 1] = '\0'; return len; } /* }}} size_t cdtime_to_iso8601 */ -- 2.11.0