note 20510 added to function.mktime

From: Date: Fri, 05 Apr 2002 21:26:25 +0000
Subject: note 20510 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-28683@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; ?> -- http://www.php.net/manual/en/function.mktime.php http://master.php.net/manage/user-notes.php?action=edit+20510 http://master.php.net/manage/user-notes.php?action=delete+20510 http://master.php.net/manage/user-notes.php?action=reject+20510

« previous php.notes (#28683) next »