From 06fa016582ef04df698618e88f8e70fd7cfa1de0 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 25 Apr 2013 17:51:02 +0200 Subject: modem-helpers: fix ISO8601 string when offset is negative So now we get this: 2013-04-25T17:44:36-02:00 Instead of this: 2013-04-25T17:44:36--2:00 --- src/mm-modem-helpers.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 98fb39e2a..44a00a53f 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -232,10 +232,16 @@ mm_new_iso8601_time (guint year, g_string_append_printf (str, "%04d-%02d-%02dT%02d:%02d:%02d", year, month, day, hour, minute, second); if (have_offset) { - g_string_append_printf (str, "%c%02d:%02d", - offset_minutes >= 0 ? '+' : '-', - offset_minutes / 60, - offset_minutes % 60); + if (offset_minutes >=0 ) { + g_string_append_printf (str, "+%02d:%02d", + offset_minutes / 60, + offset_minutes % 60); + } else { + offset_minutes *= -1; + g_string_append_printf (str, "-%02d:%02d", + offset_minutes / 60, + offset_minutes % 60); + } } return g_string_free (str, FALSE); } -- cgit v1.2.1