I think it''s date_obj.to_datetime
On Tuesday, June 2, 2009 12:54:48 AM UTC+1, Rick DeNatale
wrote:>
> On Mon, Jun 1, 2009 at 7:44 PM, David
<dly...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org <javascript:>>
> wrote:
> >
> > The method I am using to convert Date objects to DateTime objects is:
> >
> > date_obj = DateTime.parse(Date.to_s)
> >
> > Is this an okay way to go about doing this? Or is there a more
> > efficient way?
>
> Well, on Rails you can do
>
> date_obj.to_date_time
>
> It''s part of ActiveSupport
>
> --
> Rick DeNatale
>
> Blog: http://talklikeaduck.denhaven2.com/
> Twitter: http://twitter.com/RickDeNatale
> WWR: http://www.workingwithrails.com/person/9021-rick-denatale
> LinkedIn: http://www.linkedin.com/in/rickdenatale
>
>
--
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
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
To view this discussion on the web visit
https://groups.google.com/d/msg/rubyonrails-talk/-/agrv2abWw5oJ.
For more options, visit https://groups.google.com/groups/opt_out.