summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NEWS1
-rw-r--r--ext/date/php_date.c2
2 files changed, 3 insertions, 0 deletions
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 <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;