Skip to content

Instantly share code, notes, and snippets.

@vajradog
Created March 14, 2014 16:09
Show Gist options
  • Save vajradog/9550833 to your computer and use it in GitHub Desktop.
Save vajradog/9550833 to your computer and use it in GitHub Desktop.
formatting date to words in rails
<%= applicant.start_date %> gives out 2014-04-14
<%= applicant.start_date.strftime("%B %d, %Y") %> gives out April 14, 2014
<%= applicant.start_date.strftime("%B #{applicant.start_date.day.ordinalize}, %Y") %> gives out April 14th, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment