note 20510 deleted from function.mktime by jimw
| From: | jimw@php.net | Date: | Sat, 06 Apr 2002 00:14:42 +0000 |
| Subject: | note 20510 deleted from function.mktime by jimw | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-28686@lists.php.net to get a copy of this message | ||
Be careful when using mktime. This example should result 1, but it actually gives 0.95833333333333
(!!!)
Strange but it works right with other months..
PHP 4.0.6 / Windows XP
<?
function Date2Timestamp($date){
return mktime(0,0,0, (substr($date,5,2)-0), (substr($date,8,2)-0), (substr($date,0,4)-0));
}
echo (Date2Timestamp('2002-04-01') - Date2Timestamp('2002-03-31'))/60/60/24;
?>