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.
This commit is contained in:
Jef Driesen 2022-05-13 21:13:54 +02:00
parent 4512a0a5d7
commit 82c0134811

View File

@ -238,7 +238,7 @@ dctool_xml_output_write (dctool_output_t *abstract, dc_parser_t *parser, const u
fprintf (output->ostream, "<datetime>%04i-%02i-%02i %02i:%02i:%02i %+03i:%02i</datetime>\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.