From 51e5d571aaf4439a7ef8b00c7be505b0333b1f73 Mon Sep 17 00:00:00 2001 From: Gregor Harlan Date: Sun, 5 Feb 2017 20:13:24 +0100 Subject: [PATCH] do not lose microseconds when converting datetime objects --- src/AbstractDateTime.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/AbstractDateTime.php b/src/AbstractDateTime.php index e1e2f95..5f4b11c 100644 --- a/src/AbstractDateTime.php +++ b/src/AbstractDateTime.php @@ -46,7 +46,7 @@ public static function createFromDateTime(\DateTimeInterface $dateTime): self $class = static::getClass(); - return new $class($dateTime->format('Y-m-d H:i:s'), $dateTime->getTimezone()); + return new $class($dateTime->format('Y-m-d H:i:s.u'), $dateTime->getTimezone()); } /**