* src/editfns.c (tzlookup): Fix sign error in %Z when a purely
numeric zone is negative (Bug#28746).
* test/src/editfns-tests.el (format-time-string-with-zone):
Add test for this bug.
if (sec != 0)
prec += 2, numzone = 100 * numzone + sec;
}
- sprintf (tzbuf, tzbuf_format, prec, numzone,
+ sprintf (tzbuf, tzbuf_format, prec,
+ XINT (zone) < 0 ? -numzone : numzone,
&"-"[XINT (zone) < 0], hour, min, sec);
zone_string = tzbuf;
}
(should (string-equal
(format-time-string format look '(-28800 "PST"))
"1972-06-30 15:59:59.999 -0800 (PST)"))
+ ;; Negative UTC offset, as a Lisp integer.
+ (should (string-equal
+ (format-time-string format look -28800)
+ "1972-06-30 15:59:59.999 -0800 (-08)"))
;; Positive UTC offset that is not an hour multiple, as a string.
(should (string-equal
(format-time-string format look "IST-5:30")