diff --git a/src/controllers/Items/Sync.php b/src/controllers/Items/Sync.php index 6490d0bd7b..6b83f88b4d 100644 --- a/src/controllers/Items/Sync.php +++ b/src/controllers/Items/Sync.php @@ -56,11 +56,12 @@ public function sync(Base $f3) { } $since = new \DateTime($params['since']); + $since->setTimeZone(new \DateTimeZone(date_default_timezone_get())); $last_update = new \DateTime($this->itemsDao->lastUpdate()); $sync = [ - 'lastUpdate' => $last_update->format('Y-m-d H:i:s'), + 'lastUpdate' => $last_update->format(\DateTime::ATOM), ]; $sinceId = 0; @@ -72,6 +73,7 @@ public function sync(Base $f3) { $sinceId = $this->itemsDao->lowestIdOfInterest() - 1; // only send 1 day worth of items $notBefore = new \DateTime(); + $notBefore->setTimeZone(new \DateTimeZone(date_default_timezone_get())); $notBefore->sub(new \DateInterval('P1D')); }