is there a PHP function that will convert a MySQL formatted date like "2004-09-05" to "July 9, 2004"?
Why dont you make MySQL do it for you.
SELECT DATE_FORMAT('2004-09-05','%M %e %Y')
Also its actually September not July.
try date() along with strtotime()
// format date to Month day, Year $formatted = date('F d, Y', strtotime($sqldate));
thank you, that worked perfectly.
In reponse to the previous post from planetsim, i couldn't let MySQL format it because the date is stored in a string, not on it's own. thank you though.
the date is stored in a string, not on it's own.
why? when MySQL has a perfectly adequate DATE column type and plenty of useful date manipulation functions.
planetsim: it looks like he's using US date format strings (YYYY-DD-MM) rather than the standard MySQL format (YYYY-MM-DD).
because the table column is holding multiple values including dates, coordinates and amounts of time contained in a string. this way i don't need to account for an indefinite amount of entries causing the need for an indefinite amount of columns.