summaryrefslogtreecommitdiff
path: root/ext/date/php_date.c
diff options
context:
space:
mode:
Diffstat (limited to 'ext/date/php_date.c')
-rw-r--r--ext/date/php_date.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index e8a457052e..47b79bc250 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -1095,7 +1095,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;
+ case 'u': length = slprintf(buffer, 32, "%06d", (int) floor(t->f * 1000000 + 0.5)); break;
/* timezone */
case 'I': length = slprintf(buffer, 32, "%d", localtime ? offset->is_dst : 0); break;