note 69387 modified in function.date by danbrown
| From: | danbrown@php.net | Date: | Sun, 20 Jul 2008 02:55:34 +0000 |
| Subject: | note 69387 modified in function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-142002@lists.php.net to get a copy of this message | ||
***EDITOR NOTE: Referred to note has been removed.
The calculation function of the number of days between 2 dates by zzzdobr at gmai dot com could be
done much easier:
<?php
function getdays($day1,$day2)
{
return round((strtotime($day2)-strtotime($day1))/(24*60*60),0);
}
$begin = date("Y/m/d"); // we set today as an example
$end = "2006/11/27";
getdays($begin,$end);
?>
So now all of you know how many days you have left to buy me a birthday present ;)
--was--
***EDITOR NOTE: Referred to note has been removed.
The calculation function of the number of days between 2 dates by zzzdobr at gmai dot com could be
done much easier:
<?
function getdays($day1,$day2)
{
return round((strtotime($day2)-strtotime($day1))/(24*60*60),0);
}
$begin = date("Y/m/d"); // we set today as an example
$end = "2006/11/27";
getdays($begin,$end);
?>
So now all of you know how many days you have left to buy me a birthday present ;)
http://php.net/manual/en/function.date.php