Skip to content

Commit ffe6d81

Browse files
committed
Fix ZTS RELEASE for date ext
1 parent d33c08a commit ffe6d81

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

ext/date/php_date.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,8 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
798798
offset->abbr = timelib_malloc(9); /* GMT±xxxx\0 */
799799
snprintf(offset->abbr, 9, "GMT%c%02d%02d",
800800
(offset->offset < 0) ? '-' : '+',
801-
abs(offset->offset / 3600),
801+
/* Module 100 000 as 24 * 3600 = 86400 */
802+
abs((offset->offset % 100000) / 3600),
802803
abs((offset->offset % 3600) / 60));
803804
} else {
804805
offset = timelib_get_time_zone_info(t->sse, t->tz_info);
@@ -1008,9 +1009,10 @@ PHPAPI int php_idate(char format, time_t ts, int localtime)
10081009
offset->leap_secs = 0;
10091010
offset->is_dst = t->dst;
10101011
offset->abbr = timelib_malloc(9); /* GMT±xxxx\0 */
1011-
snprintf(offset->abbr, 9, "GMT%c%02d%02d",
1012+
snprintf(offset->abbr, 9, "GMT%c%02d%2d",
10121013
(offset->offset < 0) ? '-' : '+',
1013-
abs(offset->offset / 3600),
1014+
/* Module 100 000 as 24 * 3600 = 86400 */
1015+
abs((offset->offset % 100000) / 3600),
10141016
abs((offset->offset % 3600) / 60));
10151017
} else {
10161018
offset = timelib_get_time_zone_info(t->sse, t->tz_info);

0 commit comments

Comments
 (0)