Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Rails 3 Finding day of week

I'm trying to make my own calendar because i cant seem to get any help with event calendar so what im trying to do is Display the day of the week ie.. January 1 2011 is a Saturday is there an easy command to get that day or do i need something else

like image 807
Rod Nelson Avatar asked Jan 30 '11 17:01

Rod Nelson


2 Answers

You can also get the string, like "Wednesday", using time.strftime("%A")

like image 54
Alex T Avatar answered Nov 05 '22 10:11

Alex T


Can't you use time.wday, 0 = sunday and so on

like image 134
Ta01 Avatar answered Nov 05 '22 08:11

Ta01