Page 1 of 1

Formatting the way a stored date displays...

Posted: Sat Feb 18, 2006 8:24 pm
by michlcamp
I have a form field ('date') that stores the date in a table as : '02-19-2006'

(These are future calendar dates that make up an "Upcoming Events" page...)

I need to display it on the output page as: 'Saturday February 19, 2006'

but still want to sort the query output using 'ORDER BY 'date'

how to?

Thanks in advance.
mc

Posted: Sat Feb 18, 2006 8:35 pm
by s.dot

Code: Select all

$date = $row['date'];
$timestamp = strtotime($date);
$newDate = date($timestamp,"date format string here");
Although I believe there is a date format function... in MySQL. I forget the name of it. :(

Posted: Sat Feb 18, 2006 8:59 pm
by michlcamp
thanks. found a way.
solved.