There is a function called strtotime() which parses English textual datetime strings into a UNIX timestamp. I can't remember whether that works with mySql DATE format - I think you might have to change it with something like this (taken from the PHP manual page):
ereg_replace('([0-9]).([0-9]).([0-9]*)','\2/\1/\3', $s)
to turn it into American date format. Even so, that might be a bit more efficient than lots of string explodes, etc.
You can then use date() to turn that timestamp into a human readable string in any format you want.
Kevin.
John Koetsier wrote:
OK, stupid question, but I can't find the answer.
I'm pulling some dates out of MySQL that are in DATE format: YYYY-MM-DD. I want to give them in human friendly January 10, 2001 format WITHOUT having to do a complex explode and replace operation on every single date (when I might have up to 350 or 400 on a single page).
Is there a real easy and low-overhead way of doing this?
-john