diff --git a/lib/Db/Util.php b/lib/Db/Util.php index 9a1c05c4..a7d3dcdb 100644 --- a/lib/Db/Util.php +++ b/lib/Db/Util.php @@ -55,6 +55,7 @@ class Util { $fileId = $file->getId(); $dateTaken = $this->getDateTaken($file); $dayId = floor($dateTaken / 86400); + $dateTaken = gmdate('Y-m-d H:i:s', $dateTaken); $sql = 'INSERT INTO oc_polaroid (day_id, date_taken, is_video, user_id, file_id) @@ -66,9 +67,9 @@ class Util { $user, $fileId, $dayId, $dateTaken, $is_video, ], [ - \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_BOOL, + \PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_BOOL, \PDO::PARAM_STR, \PDO::PARAM_INT, - \PDO::PARAM_INT, \PDO::PARAM_INT, \PDO::PARAM_BOOL, + \PDO::PARAM_INT, \PDO::PARAM_STR, \PDO::PARAM_BOOL, ]); } diff --git a/lib/Migration/Version000000Date20220812163631.php b/lib/Migration/Version000000Date20220812163631.php index c06e1a04..fba2d50b 100644 --- a/lib/Migration/Version000000Date20220812163631.php +++ b/lib/Migration/Version000000Date20220812163631.php @@ -30,7 +30,7 @@ 'notnull' => true, 'length' => 200, ]); - $table->addColumn('date_taken', Types::INTEGER, [ + $table->addColumn('date_taken', Types::DATETIME, [ 'notnull' => false, ]); $table->addColumn('file_id', Types::BIGINT, [