I have a string value something like the below values
9/21/2010
9/24/2010
And I want to convert those to
September 21nd, 2010
September 24th, 2010
is there an easy way of doing this? Or do I have to do it the hard way?
PS. This is strictly javascript, please don’t post jQuery examples.
Thanks!
It depends on what you mean by “the hard way”. One way is to split the date into it’s components and convert to date (assuming US m/d/y format) and then format the date object how you want:
Another is to just convert the month to its name:
Edit
Added the ordinal to date.