What's the most efficient way get the first day of the current month?

datetime, ruby

Solution

Time.parse("2009-10-26").strftime("%Y-%m-01")

Problem

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.

Original source