diff options
author | andrewnester <andrew.nester.dev@gmail.com> | 2017-03-24 19:23:15 +0300 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-04-09 12:56:21 +0200 |
commit | 1ce355abb648dc6814ddd00876085617a946396f (patch) | |
tree | 1b84f373066aa3c58a520ce61b3b407559249868 /ext/intl/common/common_date.cpp | |
parent | a813cebff082398f0bbdb0d95ece10ea14b9d946 (diff) | |
download | php-git-1ce355abb648dc6814ddd00876085617a946396f.tar.gz |
Fixed #74298 - IntlDateFormatter->format() doesn't return microseconds/fractions
Diffstat (limited to 'ext/intl/common/common_date.cpp')
-rw-r--r-- | ext/intl/common/common_date.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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); } |