note 82467 added to function.mktime

From: Date: Sat, 12 Apr 2008 03:59:01 +0000
Subject: note 82467 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-138197@lists.php.net to get a copy of this message
In response to : zhenya dot t at livelynk dot com You said : mktime() seems to produce an incorrect result when you have months and dates prefixed with 0. eg. mktime(0, 0, 0, 04, 08, 2008); will produce an incorrect result where as mktime(0, 0, 0, 4, 8, 2008); produces the correct result. --------------------------------------------------- Resolution: You can simply call the function intval(<your parameter>) inside the function: eg. mktime(0, 0, 0, intval('04'), intval('08'), 2008); will produce a correct result ---- Server IP: 216.235.15.211 Probable Submitter: 67.70.26.212 ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- https://master.php.net/note/edit/82467 Del: integrated -- https://master.php.net/note/delete/82467/integrated Del: useless -- https://master.php.net/note/delete/82467/useless Del: bad code -- https://master.php.net/note/delete/82467/bad+code Del: spam -- https://master.php.net/note/delete/82467/spam Del: non-english -- https://master.php.net/note/delete/82467/non-english Del: in docs -- https://master.php.net/note/delete/82467/in+docs Del: other reasons-- https://master.php.net/note/delete/82467 Reject -- https://master.php.net/note/reject/82467 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138197) next »