]> granicus.if.org Git - php/commitdiff
- Fixed bug #39416 (Milliseconds in date()).
authorDerick Rethans <derick@php.net>
Fri, 13 Apr 2007 14:09:20 +0000 (14:09 +0000)
committerDerick Rethans <derick@php.net>
Fri, 13 Apr 2007 14:09:20 +0000 (14:09 +0000)
NEWS
ext/date/php_date.c

diff --git a/NEWS b/NEWS
index ecc2bfe1b234ef3fd9b4bed257b9d42cb0769f9a..31a937f11448259564098ff378412d6f4df7e893 100644 (file)
--- 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
index ea896b6f87159cebb8d96b1cd3c6b8beeb46fb0a..5e0ec7c1a5eef24eccc2aef878e33c91269d60d9 100644 (file)
@@ -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 <time.h>
@@ -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;