From 1ce355abb648dc6814ddd00876085617a946396f Mon Sep 17 00:00:00 2001 From: andrewnester Date: Fri, 24 Mar 2017 19:23:15 +0300 Subject: Fixed #74298 - IntlDateFormatter->format() doesn't return microseconds/fractions --- ext/intl/common/common_date.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ext/intl/common/common_date.cpp') diff --git a/ext/intl/common/common_date.cpp b/ext/intl/common/common_date.cpp index 98c6393a84..26c198bc42 100644 --- a/ext/intl/common/common_date.cpp +++ b/ext/intl/common/common_date.cpp @@ -125,6 +125,8 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, } if (millis) { + php_date_obj *datetime; + ZVAL_STRING(&zfuncname, "getTimestamp"); if (call_user_function(NULL, z, &zfuncname, &retval, 0, NULL) != SUCCESS || Z_TYPE(retval) != IS_LONG) { @@ -137,7 +139,8 @@ U_CFUNC int intl_datetime_decompose(zval *z, double *millis, TimeZone **tz, return FAILURE; } - *millis = U_MILLIS_PER_SECOND * (double)Z_LVAL(retval); + datetime = Z_PHPDATE_P(z); + *millis = U_MILLIS_PER_SECOND * ((double)Z_LVAL(retval) + datetime->time->f); zval_ptr_dtor(&zfuncname); } -- cgit v1.2.1