skip to Main Content

compare two dateTime Objects in PHP (Symfony 7)

#[Route('/show/{id}', name: 'app_warning_show', methods: ['GET'])] public function show(Warning $warning): Response { $time = new DateTime('now'); $this->checkAccess(['ROLE_WHITELIST','ROLE_FRACTION','ROLE_SUPPORT','ROLE_ADMIN']); return $this->render('warning/show.html.twig', [ 'warning' => $warning, 'expired' => $time > $warning->getEnd(), ]); } Created Datetime in DB -> 2024-04-06 12:13:00 Duration are 10h public…

VIEW QUESTION
Back To Top
Search