0
In this case how I can convert without using the method
DATE_FORMAT(data_access, '%Y-%m-%d-%H-%i-%s') in SELECT
<?php
$resul_ult_aces = "SELECT as data_acesso FROM adms_ultimos_acessos
WHERE adms_usuario_id = '".$row_user['id']."'
ORDER BY id DESC LIMIT 1";
$resultado_ult_aces = mysqli_query($conn, $resul_ult_aces);
$row_ult_aces = mysqli_fetch_assoc($resultado_ult_aces);
$data_atual = date("Y-m-d H:i:s");
$data_ult_aces = $row_ult_aces['data_acesso'];
$ob_data_atual = new DateTime($data_atual);
$ob_data_ult_aces = new DateTime($data_ult_aces);
$intervalo = $ob_data_atual->diff($ob_data_ult_aces);
?>
you want to edit $current date or $data_ult_aces?
– Deividson Oliveira
both so that I can solve a mistake, indeed try to see if it is so.
– Wesley Roberto