I want to get minutes between now and future time, please help me!
$time = now - future time
echo minutes
I want to get minutes between now and future time, please help me!
$time = now - future time
echo minutes
I think you are looking for this:
date('Y-m-d H:i:s')
Check this link for more information http://pl.php.net/manual/en/function.date.php
If you are looking for the Datetime class check out this link: http://php.net/manual/en/class.datetime.php
If you want the diffrence between times you'll need this:
$to_time = strtotime("2008-12-13 10:42:00");
$from_time = strtotime("2008-12-13 10:21:00");
echo round(abs($to_time - $from_time) / 60,2). " minute";
You can use DateTime class to get desired result
$now = new DateTime();
$date = new DateTime("2014-10-20 12:13:29");
//calculate the difference between two dates
$diff = $now->diff($date);
//caculate number of minutes between two dates
$minutes = $diff->days * 24 * 60;
$minutes += $diff->h * 60;
$minutes += $diff->i;
// display difference in minutes
echo $minutes.' minutes';