diff options
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r-- | ext/date/php_date.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c index 59eb4f2a8d..c152c71d3d 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -1165,7 +1165,7 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t length = slprintf(buffer, sizeof(buffer), "%02d", (int) isoweek); break; /* iso weeknr */ case 'o': if(!weekYearSet) { timelib_isoweek_from_date(t->y, t->m, t->d, &isoweek, &isoyear); weekYearSet = 1; } - length = slprintf(buffer, sizeof(buffer), "%d", (int) isoyear); break; /* iso year */ + length = slprintf(buffer, sizeof(buffer), ZEND_LONG_FMT, (zend_long) isoyear); break; /* iso year */ /* month */ case 'F': length = slprintf(buffer, sizeof(buffer), "%s", mon_full_names[t->m - 1]); break; @@ -1176,7 +1176,7 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t /* year */ case 'L': length = slprintf(buffer, sizeof(buffer), "%d", timelib_is_leap((int) t->y)); break; - case 'y': length = slprintf(buffer, sizeof(buffer), "%02d", (int) t->y % 100); break; + case 'y': length = slprintf(buffer, sizeof(buffer), "%02d", (int) (t->y % 100)); break; case 'Y': length = slprintf(buffer, sizeof(buffer), "%s%04lld", t->y < 0 ? "-" : "", php_date_llabs((timelib_sll) t->y)); break; /* time */ @@ -1235,18 +1235,18 @@ static zend_string *date_format(char *format, size_t format_len, timelib_time *t case 'Z': length = slprintf(buffer, sizeof(buffer), "%d", localtime ? offset->offset : 0); break; /* full date/time */ - case 'c': length = slprintf(buffer, sizeof(buffer), "%04d-%02d-%02dT%02d:%02d:%02d%c%02d:%02d", - (int) t->y, (int) t->m, (int) t->d, + case 'c': length = slprintf(buffer, sizeof(buffer), "%04" ZEND_LONG_FMT_SPEC "-%02d-%02dT%02d:%02d:%02d%c%02d:%02d", + (zend_long) t->y, (int) t->m, (int) t->d, (int) t->h, (int) t->i, (int) t->s, localtime ? ((offset->offset < 0) ? '-' : '+') : '+', localtime ? abs(offset->offset / 3600) : 0, localtime ? abs((offset->offset % 3600) / 60) : 0 ); break; - case 'r': length = slprintf(buffer, sizeof(buffer), "%3s, %02d %3s %04d %02d:%02d:%02d %c%02d%02d", + case 'r': length = slprintf(buffer, sizeof(buffer), "%3s, %02d %3s %04" ZEND_LONG_FMT_SPEC " %02d:%02d:%02d %c%02d%02d", php_date_short_day_name(t->y, t->m, t->d), (int) t->d, mon_short_names[t->m - 1], - (int) t->y, (int) t->h, (int) t->i, (int) t->s, + (zend_long) t->y, (int) t->h, (int) t->i, (int) t->s, localtime ? ((offset->offset < 0) ? '-' : '+') : '+', localtime ? abs(offset->offset / 3600) : 0, localtime ? abs((offset->offset % 3600) / 60) : 0 |