Click to See Complete Forum and Search --> : reformatting a date from a mysql record


Brian@nif2
04-16-2007, 11:07 AM
I'm trying to display a date only from a mysql record, as normal UK format.
So trying to switch from YYYY-MM-DD to what php refers to as d m Y.

I've searched the net and a few books I have for about 3 hours now on how to reformat the date, and all I can find is the date_format command. I've tried this, but it doesn't appear to work with a date only field, it returns an error that it is expecting DateTime in parameter1, or something like that.

Does anyone know if there is a way to work around this, possibly a way to parse the date and rebuild it in the order I want it, or a command that works with the date only.

Any help much appreciatted.

Brian@nif2
04-16-2007, 12:11 PM
Resolved using date ("d/m/Y" strtotime($recordset['field']));