@@ -798,7 +798,8 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t
798
798
offset -> abbr = timelib_malloc (9 ); /* GMT±xxxx\0 */
799
799
snprintf (offset -> abbr , 9 , "GMT%c%02d%02d" ,
800
800
(offset -> offset < 0 ) ? '-' : '+' ,
801
- abs (offset -> offset / 3600 ),
801
+ /* Module 100 000 as 24 * 3600 = 86400 */
802
+ abs ((offset -> offset % 100000 ) / 3600 ),
802
803
abs ((offset -> offset % 3600 ) / 60 ));
803
804
} else {
804
805
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)
1008
1009
offset -> leap_secs = 0 ;
1009
1010
offset -> is_dst = t -> dst ;
1010
1011
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 " ,
1012
1013
(offset -> offset < 0 ) ? '-' : '+' ,
1013
- abs (offset -> offset / 3600 ),
1014
+ /* Module 100 000 as 24 * 3600 = 86400 */
1015
+ abs ((offset -> offset % 100000 ) / 3600 ),
1014
1016
abs ((offset -> offset % 3600 ) / 60 ));
1015
1017
} else {
1016
1018
offset = timelib_get_time_zone_info (t -> sse , t -> tz_info );
0 commit comments