Wednesday, 11 September 2013

MySQL date_format showing '1st', '2nd', '3rd'

MySQL date_format showing '1st', '2nd', '3rd'

I'm making a change to my date outputs and trying to show nd, rd, st,
etc., like 1st September 2013 or 3rd. Looking at the manual 'jS' should do
it but it is just outputting nonsense. Does anyone know what are the
correct letter(s) to use?
DATE_FORMAT(date, "%jS %M %Y") AS Displaydate
EDIT: my bad, I thought date_format was PHP not MySQL - sorry.

No comments:

Post a Comment