I have a row in my database that displays the date in the following format: 2012-04-26 . Say i take that value and store it in a variable @date. How can i change that format to say, 04-26-2012, or maybe even April 26th ?
I have a row in my database that displays the date in the following
Share
Great snippet covering your problem: http://snippets.dzone.com/posts/show/2255
Example usage:
<%= @date.strftime("%d-%m-%Y") %>