Skip to content

Commit 8db0534

Browse files
committed
PdoDriver: formats datetime as unix-timestamp for compatiblity with SqliteDriver
1 parent cc3b09e commit 8db0534

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Dibi/Drivers/PdoDriver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,8 @@ public function escapeDateTime(\DateTimeInterface $value): string
304304
case 'dblib':
305305
case 'sqlsrv':
306306
return 'CONVERT(DATETIME2(7), ' . $value->format("'Y-m-d H:i:s.u'") . ')';
307+
case 'sqlite':
308+
return $value->format('U');
307309
default:
308310
return $value->format("'Y-m-d H:i:s.u'");
309311
}

0 commit comments

Comments
 (0)