Time difference between two dates with php

Asked

Viewed 15 times

1

Accurate with php compare 2 dates and check if their interval is already greater than 1 hour:

An idea more or less just to understand better:

NOTE: I need the Hour Minutes and Seconds!

<?php 

    $data_atual = "09-10-2018 20:00:00";
    $data_passada = "09-10-2018 19:00:00";

    if ($data_atual > $data_passada){
        echo "Faz mais de 1 hora entre as datas";
    }
?>
  • In Vd I need the hours and minutes and seconds... but the idea is that there I need only the hours

  • 1

    Staff Solved !

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.