hey people,
I have a datetime stamp on my mysql database i.e: 2006-12-05 20:23:51
Which is December 2006.
I want to read the month and year from that date using mktime so I did this:
$id = '2006-12';
date("F Y", mktime ( 0, 0, 0, substr($id,5,2), 0, substr($id,0,4)))
But when I do that it reads out:
November 2006
I did it on a number of dates and they all seem to be reading out the previous month to what it should be.
So to fix this I done this:
$id = '2006-12';
date("F Y", mktime ( 0, 0, 0, substr($id,5,2)+1, 0, substr($id,0,4)))
But I don't see why I should have to do that?
Does anyone know why it wouldn't just read it out properly?
Thanks