eduardo12fox
asked on
Difference in hours between dates
I have two different dates and different times, I would like to know how to do the calculation to get the difference in hours between these two dates example:
$Date1 = "2012-01-01";
$Date2 = "2012-01-02";
$hora1 = "20:00:00";
$hora2 = "21:00:00";
How to calculate the difference between days and hours?
$Date1 = "2012-01-01";
$Date2 = "2012-01-02";
$hora1 = "20:00:00";
$hora2 = "21:00:00";
How to calculate the difference between days and hours?
use date_add
date_sub — Subtracts an amount of days, months, years, hours, minutes and seconds from a DateTime object
http://php.net/manual/en/datetime.sub.php
http://php.net/manual/en/datetime.sub.php
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Very, very thank you!!