Skip to content

Commit

Permalink
Transform time to UTC before storing in the database
Browse files Browse the repository at this point in the history
Signed-off-by: Joas Schilling <coding@schilljs.com>
  • Loading branch information
nickvergessen committed Jul 23, 2019
1 parent 927c4c1 commit ede1750
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/Controller/WebinaryController.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,12 @@ public function __construct(string $appName,
public function setLobby(int $state, ?string $timer = null): DataResponse {
$timerDateTime = null;
if (trim((string) $timer) !== '') {
$timerDateTime = $this->timeFactory->getDateTime($timer);
try {
$timerDateTime = $this->timeFactory->getDateTime($timer);
$timerDateTime->setTimezone(new \DateTimeZone('UTC'));
} catch (\Exception $e) {
return new DataResponse([], Http::STATUS_BAD_REQUEST);
}
}

if (!$this->room->setLobby($state, $timerDateTime)) {
Expand Down

0 comments on commit ede1750

Please sign in to comment.