From 82c01348116c667cf946a9f403cb43ca03a9ff79 Mon Sep 17 00:00:00 2001 From: Jef Driesen Date: Fri, 13 May 2022 21:13:54 +0200 Subject: [PATCH] Fix the timezone offset in the xml output For negative timezone offsets, only the hour part should have a sign. The minute part must always be formatted as a positive number. --- examples/output_xml.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/output_xml.c b/examples/output_xml.c index 9a5a9a8..854646b 100644 --- a/examples/output_xml.c +++ b/examples/output_xml.c @@ -238,7 +238,7 @@ dctool_xml_output_write (dctool_output_t *abstract, dc_parser_t *parser, const u fprintf (output->ostream, "%04i-%02i-%02i %02i:%02i:%02i %+03i:%02i\n", dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, - dt.timezone / 3600, (dt.timezone % 3600) / 60); + dt.timezone / 3600, (abs(dt.timezone) % 3600) / 60); } // Parse the divetime.