Possible Duplicate:
Numerical Date To Text Date PHP
I'm trying to find a way to convert a date to a more "user-friendly" format.
For example, from 2011-01-05 to Jan 5th, 2011.
I'm sure it's something simple, I just can't seem to find it anywhere. Any ideas?
For the th
add the English ordinal S
uffix for the day of the month
date("M jS, Y", strtotime("2011-01-05"));
Try this:
date("M j, Y", strtotime("2011-01-05"));
You could use the DateTime
class, and call the format function. Then just set up the format using the standard date()
format string to output a textual data format.