So I have a model instance that has a datetime attribute. I am displaying it in my view using:
<%= @instance.date.to_date %>
but it shows up as: 2011-09-09
I want it to show up as: September 9th, 2011
How do I do this?
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This would give you “September 9, 2011”.
If you really needed the ordinal on the day (“th”, “rd”, etc.), you could do: