{UTC, UTC_diff} = jlib:timestamp_to_iso(Now_universal, utc),
Seconds_diff = calendar:datetime_to_gregorian_seconds(Now_local)
- calendar:datetime_to_gregorian_seconds(Now_universal),
- {Hd, Md, _} = calendar:seconds_to_time(Seconds_diff),
+ {Hd, Md, _} = case Seconds_diff >= 0 of
+ true ->
+ calendar:seconds_to_time(Seconds_diff);
+ false ->
+ {Hd0, Md0, Sd0} = calendar:seconds_to_time(-Seconds_diff),
+ {-Hd0, Md0, Sd0}
+ end,
{_, TZO_diff} = jlib:timestamp_to_iso({{0, 0, 0}, {0, 0, 0}}, {Hd, Md}),
IQ#iq{type = result,
sub_el = [{xmlelement, "time",