I'm about to pull my hair out people. I've got a form where people select a day and a month from the dropdown menu, and the current year would automatically get concatenated.
On the server I've got this:
$received = date("Y")."-".$_POST['month']."-".$_POST['day'];
$date = strtotime($received);
$newformat = date('Y F j',$date);
echo $newformat;
Let's say $_POST['month'] == 'April' and $_POST['day'] == '5'
The output always comes out like this:
2013 April 1 (ie the day defaults to 1).
Interestingly if $_POST['day'] == '24' then the output is:
2013 April 2
It's as though it just looks at the first digit.. Any ideas would be greatly appreciated!
$receivedcontains?echo $received;I'll get2013-April-5- correct output..$newformat = date('Y-F-j',$date);I get the same thing -2013-April-1