Skip to content
Snippets Groups Projects
Commit a330b2ef authored by Andreas Fischer's avatar Andreas Fischer
Browse files

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.
parent 9fb1da28
No related branches found
No related tags found
No related merge requests found
......@@ -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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment