I have a simple function to convert a month from its number to name, i.e 10 to October
function convertToName($month) {
$month = date('F', mktime(0, 0, 0, $month));
return $month;
}
This was working fine, up until, it seems, the clocks went back an hour. I'm now getting the wrong name back.
I've tried defining the timezone with date_default_timezone_set, but still nothing.
What's weird is, if you pass the function 10, it returns October, but pass it 11 or 12, it returns December, pass 1, January, 2 and 3 returns March, and so on.
I'm guessing there must be a pretty simple fix, but can't seem to find an answer anywhere,
any help would be appreciated,
thanks.