I need a script that can take a date given in m d Y g:i format, and find out the difference between the current, and that date.
I tried to make a test script, which failed, because I keep getting 0 as my answer.
Any suggestions and help would be greatly appreciated.
Code: Select all
<?php
$time = date('m d Y g:i');
echo "$time";
echo "<br><br>";
$tomorrow = mktime(date("g"),date("i"),0,date("m"),date("d")+1,date("Y"));
echo "Tomorrow is ".date("m d Y g:i", $tomorrow);
echo "<br><br>";
$start = strtotime ($time);
$end = strtotime ($tomorrow);
$diff = $end - $start;
echo "$diff";
?>