Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Human Readable Date in Rails

I am trying to have the current date displayed in a view within my rails app. I'd like the following format: Day of week, Month, Day, Year.

Currently I am using:

<%= Time.now.strftime("%B %d, %Y") %>

This displays everything but the day of the week. How do I add the day of the week?

like image 686
Katie H Avatar asked Jan 18 '14 22:01

Katie H


1 Answers

%A gives the day of the week

Customize how you prefer it!

<%= Time.now.strftime("%B %d, %Y, %A") %>
like image 78
Pierre Avatar answered Sep 24 '22 17:09

Pierre