note 82531 added to function.mktime

From: Date: Tue, 15 Apr 2008 13:18:23 +0000
Subject: note 82531 added to function.mktime
Groups: php.notes 
Request: Send a blank email to php-notes+get-138329@lists.php.net to get a copy of this message
> 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. This has nothing to do with mktime! It's the normal behaviour of PHP that a ANY number prefixed with '0' is treated as Octal! Try: print 015; // prints 13 which is the decimal representation of 018 Octal It's not a BUG it's a FEATURE ;-) ---- Server IP: 194.153.94.10 Probable Submitter: 193.5.216.100 ---- Manual Page -- http://www.php.net/manual/en/function.mktime.php Edit -- https://master.php.net/note/edit/82531 Del: integrated -- https://master.php.net/note/delete/82531/integrated Del: useless -- https://master.php.net/note/delete/82531/useless Del: bad code -- https://master.php.net/note/delete/82531/bad+code Del: spam -- https://master.php.net/note/delete/82531/spam Del: non-english -- https://master.php.net/note/delete/82531/non-english Del: in docs -- https://master.php.net/note/delete/82531/in+docs Del: other reasons-- https://master.php.net/note/delete/82531 Reject -- https://master.php.net/note/reject/82531 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#138329) next »