|
Posted by Robin Vickery on 10/20/75 11:25
On 8/31/05, Hal 9001 Consulting <info@hal9001.it> wrote:
> Hello,
>
> I've got a problem with mktime. It's a very strange behaviour, I don't know
> if is a bug:
>
>
> echo date ("M-d-Y", mktime (0,0,0,07,07,2005)); -> Jul-07-2005 (right)
> echo date ("M-d-Y", mktime (0,0,0,08,07,2005)); -> Dec-07-2004 (?????????)
>
> Can anyone help me to solve this question? Is it a bug?
Numbers with leading zeros are octal. 08 is not a valid octal number,
and is interpreted as 0.
The solution is to not use leading zeros...
echo date ("M-d-Y", mktime (0,0,0,8,7,2005)); -> Aug-07-2005
-robin
Navigation:
[Reply to this message]
|