>
> >
> > I'm having an weird issues with the date and mktime function thing
> > getting unexpected results, and I was wondering if y'all
> > could help clue
> > me in as to what is wrong.
> > Here's the code I'm running:
> > echo date(M, mktime(0,0,0,2)) . "\n"; Where the 2 is
> > the
>
> I'm having an weird issues with the date and mktime function thing
> getting unexpected results, and I was wondering if y'all
> could help clue
> me in as to what is wrong.
> Here's the code I'm running:
> echo date(M, mktime(0,0,0,2)) . "\n"; Where the 2 is
> the month.
> Now when I
[snip]
I think this is happening because the day is being filled in by PHP as
30. Today is March 30th.
Try these:
echo date("d M Y", mktime(0,0,0,2)) . "\n"; //02 Mar 2006
echo date("d M Y", mktime(0,0,0,3)) . "\n"; //30 Mar 2006
PHP thinks you mean Feb 30th, which doesn't exist. So it adds 2 d
Every missing argument is set to current value, so now you have
mktime(0,0,0,2,30,2006), that is March, the 2nd.
Brona
Jay Blanchard wrote:
I'm having an weird issues with the date and mktime function thing
getting unexpected results, and I was wondering if y'all could help clue
me in as to wh
I'm having an weird issues with the date and mktime function thing
getting unexpected results, and I was wondering if y'all could help clue
me in as to what is wrong.
Here's the code I'm running:
echo date(M, mktime(0,0,0,2)) . "\n"; Where the 2 is the month.
Now when I put in the number 1
5 matches
Mail list logo