I am having a problem, when uploading my website to PHP 5.6 the code I use to check if such date and such time / minute has expired is simply not respecting the time, if it is the date already speaks that expired without checking the hour / minute. Does anyone have a solution?
$sql = "SELECT * FROM noticias WHERE programada = 'sim'";
$res = mysql_query($sql) or die(mysql_error());
if(mysql_num_rows($res)>0){
$row = mysql_fetch_array($res);
function NoticiasProgramadas($data){
$dt_expira = str_replace("/", "-", $data);
$dateInicio = date('Y/m/d G:i:s', strtotime($dt_expira));
$timestamp_dt_expira = strtotime($dt_expira);
$dt_atual = date("Y/m/d G:i:s");
$timestamp_dt_atual = strtotime($dt_atual);
$ret = '';
if ($timestamp_dt_atual >= $timestamp_dt_expira) {
$ret = "exp";
}
return $ret;
}
$d = NoticiasProgramadas("$row[postdate] $row[posthora]");
if ($d == "exp"){
//executa um código mysql
}