My question is this: I created a function in PHP to check the current date and check the deadline for the end of a contest. But the end of this contest will have a specific time, and I do not know how to limit the date along with the time.
The function looks like this:
<?php
function isDateExpired($dateStart, $days){
$timestampNow = strtotime('now');
$timestampExpired = strtotime("+{$days} day", strtotime($dateStart));
return$timestampExpired > $timestampNow) ? true : false;
}
if(isDateExpired('2014-06-09', 1)){
$teste = 'teste testado e testando';
}else{
echo '<script>alert("Concurso encerrado! Aguarde o resultado em breve!");</script>';
echo '<style>#btlike{display:none;}#btshare{display:none;</style>';
}
?>
How can I check the time of the next day? For example, the contest will close at 3pm on 06/10/2014.