Robert Walker wrote in post #958994:
> ruby-1.9.2-p0 > today = Time.now
>  => 2010-11-03 10:02:46 -0400
> ruby-1.9.2-p0 > today.at_beginning_of_month
>  => 2010-11-01 00:00:00 -0400
> ruby-1.9.2-p0 > today.beginning_of_month
>  => 2010-11-01 00:00:00 -0400
> ruby-1.9.2-p0 > today.beginning_of_month - 1.month
>  => 2010-10-01 00:00:00 -0400

Jamey Cribbs wrote
> Date.today.beginning_of_month

Or yes, using Date rather than Time as Jamie showed.

-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to