From a330b2ef9b8f3e755be0260832ba8db01c62a515 Mon Sep 17 00:00:00 2001 From: Andreas Fischer Date: Tue, 26 Nov 2013 12:00:31 +0100 Subject: [PATCH] Use DateTime object instead of fixed format date string. Use a DateTime object and have conversion handled by Doctrine instead of using a date string with a fixed format. --- lib/public/share.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/public/share.php b/lib/public/share.php index e887740ac4..708adba423 100644 --- a/lib/public/share.php +++ b/lib/public/share.php @@ -823,10 +823,9 @@ class Share { $date = null; } else { $date = new \DateTime($date); - $date = date('Y-m-d H:i', $date->format('U') - $date->getOffset()); } $query = \OC_DB::prepare('UPDATE `*PREFIX*share` SET `expiration` = ? WHERE `id` = ?'); - $query->bindValue(1, $date); + $query->bindValue(1, $date, 'datetime'); foreach ($items as $item) { $query->bindValue(2, (int) $item['id']); $query->execute();