the sign character produced came from the sign of tm_gmtoff/3600 as an
integer division, which is zero for negative offsets smaller in
magnitude than 3600. instead of printing the hours and minutes as
separate fields, print them as a single value of the form
hours*100+minutes, which naturally has the correct sign.
*l = 0;
return "";
}
- *l = snprintf(*s, sizeof *s, "%+.2ld%.2d",
- (tm->__tm_gmtoff)/3600,
- abs(tm->__tm_gmtoff%3600)/60);
+ *l = snprintf(*s, sizeof *s, "%+.4ld",
+ tm->__tm_gmtoff/3600*100 + tm->__tm_gmtoff%3600/60);
return *s;
case 'Z':
if (tm->tm_isdst < 0) {