Answers for "start date with time and end dtae with time in php"

PHP
1

calculate total time from start and end datetime in php

date1 = new DateTime('2006-04-12T12:30:00');
$date2 = new DateTime('2006-04-14T11:30:00');

$diff = $date2->diff($date1);

$hours = $diff->h;
$hours = $hours + ($diff->days*24);

echo $hours;
Posted by: Guest on June-20-2020
0

php date start of day

$startOfDay=date("Y-m-d 00:00:00");
Posted by: Guest on June-26-2021

Code answers related to "start date with time and end dtae with time in php"

Browse Popular Code Answers by Language