2

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?

Community
  • 1
  • 1
adamzwakk
  • 709
  • 2
  • 11
  • 23
  • Have a look here: http://stackoverflow.com/questions/2588998/numerical-date-to-text-date-php – D K Sep 09 '11 at 00:54
  • see http://stackoverflow.com/questions/4003476/human-readable-date-using-php – JRL Sep 09 '11 at 00:55
  • Might be worth checking out this question: http://stackoverflow.com/questions/5919387/create-user-friendly-date-in-php – mal-wan Sep 09 '11 at 00:55

3 Answers3

15

For the th add the English ordinal Suffix for the day of the month

date("M jS, Y", strtotime("2011-01-05"));
Lawrence Cherone
  • 46,049
  • 7
  • 62
  • 106
2

Try this:

date("M j, Y", strtotime("2011-01-05"));
Tchoupi
  • 14,560
  • 5
  • 37
  • 71
Ben
  • 1,525
  • 11
  • 19
0

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.

sjngm
  • 12,423
  • 14
  • 84
  • 114
dersam
  • 106
  • 1
  • 4