summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDerick Rethans <derick@php.net>2007-04-13 14:10:38 +0000
committerDerick Rethans <derick@php.net>2007-04-13 14:10:38 +0000
commita843b46454bfd263934034eea09e3f37600ae52d (patch)
tree49fb11df79b9b3522906a1794e4f8272e938ea4d
parent0c9da15a568a603c451c09235bbd89607b2a5dfd (diff)
downloadphp-git-a843b46454bfd263934034eea09e3f37600ae52d.tar.gz
- MFB: Fixed bug #39416 (Milliseconds in date()).
-rw-r--r--ext/date/php_date.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 6019f72a2a..36a4449dc6 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>
@@ -900,6 +901,7 @@ static char *date_format(char *format, int format_len, int *return_len, timelib_
case 'H': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->h); break;
case 'i': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->i); break;
case 's': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%02d", (int) t->s); break;
+ case 'u': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%06d", (int) floor(t->f * 1000000)); break;
/* timezone */
case 'I': length = date_spprintf(&buffer, 32 TSRMLS_CC, "%d", localtime ? offset->is_dst : 0); break;