I’m having the most difficult time getting the date to print May 17th, 2010 with the month (“F”) format being the issue. I’m having to get it to say November (the current month) but if I subtract from that it turns into an integer. Any help would be most appreciated! Thank you!
[php]
// Display the following date using the date() function: “May 24th, 2010”
$month = date (“F”, time()) - 6;
$day = date (“D”, time()) + 17;
$year = date (“Y”, time()) - 2;
That does result in the month being illustrated as “May” rather than “-6” which was happening with my code above however why is it that my code results as such? It seems to match the parameters outlined in php.net? To test, I used codepad.org and I came up with the same result
I don’t know what you are referring to on php.net but it certainly is not correct. By taking a string “November” and subtracting 6 you are converting the string to an integer (0) which gives you 0 - 6 = -6