From: Derick Rethans Date: Fri, 13 Apr 2007 14:09:20 +0000 (+0000) Subject: - Fixed bug #39416 (Milliseconds in date()). X-Git-Tag: php-5.2.2RC2~96 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35d5a196bd2f2ae936ab9c1bcecda2284c9cb47d;p=php - Fixed bug #39416 (Milliseconds in date()). --- diff --git a/NEWS b/NEWS index ecc2bfe1b2..31a937f114 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ PHP NEWS timezone offset). (Derick) - Fixed bug #39965 (Latitude and longitude are backwards in date_sun_info()). (Derick) +- Fixed bug #39416 (Milliseconds in date()). (Derick) 10 Apr 2007, PHP 5.2.2RC1 diff --git a/ext/date/php_date.c b/ext/date/php_date.c index ea896b6f87..5e0ec7c1a5 100644 --- a/ext/date/php_date.c +++ b/ext/date/php_date.c @@ -25,6 +25,7 @@ #include "php_ini.h" #include "ext/standard/info.h" #include "ext/standard/php_versioning.h" +#include "ext/standard/php_math.h" #include "php_date.h" #include "lib/timelib.h" #include @@ -792,6 +793,7 @@ static char *date_format(char *format, int format_len, timelib_time *t, int loca case 'H': length = slprintf(buffer, 32, "%02d", (int) t->h); break; case 'i': length = slprintf(buffer, 32, "%02d", (int) t->i); break; case 's': length = slprintf(buffer, 32, "%02d", (int) t->s); break; + case 'u': length = slprintf(buffer, 32, "%06d", (int) floor(t->f * 1000000)); break; /* timezone */ case 'I': length = slprintf(buffer, 32, "%d", localtime ? offset->is_dst : 0); break;