From 43d3b57a8d8b68ab60ff6c4c727a9e8f786b992c Mon Sep 17 00:00:00 2001 From: David Grudl Date: Wed, 26 Jul 2017 19:25:38 +0200 Subject: [PATCH] Microsoft SQL Server and MSSQL support for microseconds fix cont. --- src/Dibi/Drivers/SqlsrvDriver.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Dibi/Drivers/SqlsrvDriver.php b/src/Dibi/Drivers/SqlsrvDriver.php index 63a5ebdf..8a566ebc 100644 --- a/src/Dibi/Drivers/SqlsrvDriver.php +++ b/src/Dibi/Drivers/SqlsrvDriver.php @@ -286,7 +286,7 @@ class SqlsrvDriver implements Dibi\Driver, Dibi\ResultDriver if (!$value instanceof \DateTime && !$value instanceof \DateTimeInterface) { $value = new Dibi\DateTime($value); } - return $value->format("'Y-m-d H:i:s.u'"); + return 'CONVERT(DATETIME2(7), ' . $value->format("'Y-m-d H:i:s.u'") . ')'; }