Skip to content

Instantly share code, notes, and snippets.

@rmsaitam
Last active April 23, 2020 16:27
Show Gist options
  • Save rmsaitam/83519dee3cf2012318758e04261ad088 to your computer and use it in GitHub Desktop.
Save rmsaitam/83519dee3cf2012318758e04261ad088 to your computer and use it in GitHub Desktop.
Comparação de hora em PHP
<?php
$hora_fixa = strtotime("13:18");
$hora = strtotime(date('G:i')); //G 0-23 horas, i minutos
echo $hora .'<br>';
if($hora == $hora_fixa) {
echo "ok";
}
else {
echo "passou da hora";
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment