Skip to content

Commit

Permalink
fixup! wip: Use UTC internally
Browse files Browse the repository at this point in the history
  • Loading branch information
jtojnar committed Jul 26, 2023
1 parent 4938212 commit aaea1ac
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/daos/mysql/Items.php
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ public function add(array $values): void {
:author
)',
[
':datetime' => $values['datetime']->format('Y-m-d H:i:s'),
':datetime' => static::$stmt::datetime($values['datetime']),
':title' => $values['title']->getRaw(),
':content' => $values['content']->getRaw(),
':thumbnail' => $values['thumbnail'],
Expand Down Expand Up @@ -395,8 +395,8 @@ public function sync(int $sinceId, DateTimeImmutable $notBefore, DateTimeImmutab
$params = [
'sinceId' => [$sinceId, \PDO::PARAM_INT],
'howMany' => [$howMany, \PDO::PARAM_INT],
'notBefore' => [$notBefore->format('Y-m-d H:i:s'), \PDO::PARAM_STR],
'since' => [$since->format('Y-m-d H:i:s'), \PDO::PARAM_STR],
'notBefore' => [static::$stmt::datetime($notBefore), \PDO::PARAM_STR],
'since' => [static::$stmt::datetime($since), \PDO::PARAM_STR],
];

return static::$stmt::ensureRowTypes($this->database->exec($query, $params), [
Expand Down Expand Up @@ -585,7 +585,7 @@ public function statuses(DateTimeImmutable $since): array {
'SELECT id, unread, starred
FROM ' . $this->configuration->dbPrefix . 'items
WHERE ' . $this->configuration->dbPrefix . 'items.updatetime > :since;',
[':since' => [$since->format('Y-m-d H:i:s'), \PDO::PARAM_STR]]
[':since' => [static::$stmt::datetime($since), \PDO::PARAM_STR]]
);
$res = static::$stmt::ensureRowTypes($res, [
'id' => DatabaseInterface::PARAM_INT,
Expand Down Expand Up @@ -651,7 +651,7 @@ public function bulkStatusUpdate(array $statuses): void {
// create new status update
$sql[$id] = [
'updates' => [$sk => $statusUpdate['sql']],
'datetime' => $updateDate->format('Y-m-d H:i:s'),
'datetime' => static::$stmt::datetime($updateDate),
];
}
}
Expand Down

0 comments on commit aaea1ac

Please sign in to comment.