With ruby I'm trying to get format a date as such: 2009-10-01
Where I take the current date (2009-10-26) and then change the day to "01".
I know of ways to do this, but was curious what the shortest way is, code wise, to pull this off.
With ruby I'm trying to get format a date as such: 2009-10-01
Where I take the current date (2009-10-26) and then change the day to "01".
I know of ways to do this, but was curious what the shortest way is, code wise, to pull this off.
Like
Date.today.beginning_of_day
Date.today.end_of_day
And
Date.today.beginning_of_week
Date.today.end_of_week
There also is
Date.today.beginning_of_year
Date.today.end_of_year