There are two dates with the time in the format DATETIME (eg. 2017-12-28 15:00 and 2017-12-29 12:00)
How to get the date and time from the first to the second date?
There are two dates with the time in the format DATETIME (eg. 2017-12-28 15:00 and 2017-12-29 12:00)
How to get the date and time from the first to the second date?
As an option
$datetime1 = date_create('2017-12-28 15:00:00'); $datetime2 = date_create('2017-12-29 12:00'); $interval = date_diff($datetime1, $datetime2); echo $interval->format('%R %a дней %h часов %i минут'); Check http://sandbox.onlinephpfunctions.com/code/f673f829304db7748d6fcc9a163eef8ad9b69509
Source: https://ru.stackoverflow.com/questions/764763/
All Articles