Skip to content

Commit

Permalink
timestamp does not accept timezone, so setting it explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
waplet committed Mar 22, 2018
1 parent 02efcc4 commit f24460f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bot/MessageManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,8 @@ protected function onRoomStatus(Message $message)
$eventStartRaw = (int)$eventData['start'];
$eventEndRaw = (int)$eventData['end'];

$eventStart = new \DateTime('@' . $eventStartRaw, $timezoneReal);
$eventEnd = new \DateTime('@' . $eventEndRaw, $timezoneReal);
$eventStart = (new \DateTime('@' . $eventStartRaw))->setTimezone($timezoneReal);
$eventEnd = (new \DateTime('@' . $eventEndRaw))->setTimezone($timezoneReal);

if ($now->getTimestamp() > $eventEnd->getTimestamp()) {
// Event ended
Expand Down

0 comments on commit f24460f

Please sign in to comment.