Skip to content

Commit c656146

Browse files
committed
Change date API to use php_date_obj instead of timelib_time
1 parent 8a80edd commit c656146

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

ext/date/php_date.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -841,9 +841,9 @@ static zend_string *date_format(const char *format, size_t format_len, timelib_t
841841
return string.s;
842842
}
843843

844-
PHPAPI zend_string *php_format_date_ex(const char *format, size_t format_len, timelib_time *t, bool localtime)
844+
PHPAPI zend_string *php_format_date_obj(const char *format, size_t format_len, php_date_obj *date_obj)
845845
{
846-
return date_format(format, format_len, t, localtime);
846+
return date_format(format, format_len, date_obj->time, date_obj->time->is_localtime);
847847
}
848848

849849
static void php_date(INTERNAL_FUNCTION_PARAMETERS, bool localtime)

ext/date/php_date.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ PHPAPI int php_idate(char format, time_t ts, bool localtime);
123123

124124
PHPAPI void php_strftime(INTERNAL_FUNCTION_PARAMETERS, bool gm);
125125
PHPAPI zend_string *php_format_date(const char *format, size_t format_len, time_t ts, bool localtime);
126-
PHPAPI zend_string *php_format_date_ex(const char *format, size_t format_len, timelib_time *t, bool localtime);
126+
PHPAPI zend_string *php_format_date_obj(const char *format, size_t format_len, php_date_obj *date_obj);
127127

128128
/* Mechanism to set new TZ database */
129129
PHPAPI void php_date_set_tzdb(timelib_tzdb *tzdb);

ext/soap/php_encoding.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2910,7 +2910,7 @@ static xmlNodePtr to_xml_datetime_ex(encodeTypePtr type, zval *data, char *forma
29102910
if (instanceof_function_slow(Z_OBJCE_P(data), php_date_get_interface_ce())) {
29112911
php_date_obj *dateobj = Z_PHPDATE_P(data);
29122912
if (dateobj->time) {
2913-
zend_string *formatted = php_format_date_ex(ext_date_format, ext_date_format_len, dateobj->time, dateobj->time->is_localtime);
2913+
zend_string *formatted = php_format_date_obj(ext_date_format, ext_date_format_len, dateobj);
29142914
xmlNodeSetContentLen(xmlParam, BAD_CAST(ZSTR_VAL(formatted)), ZSTR_LEN(formatted));
29152915
zend_string_release_ex(formatted, false);
29162916
} else {

0 commit comments

Comments
 (0)