On Fri, Dec 08, 2006 at 06:13:24AM +0100, petr wrote:> How do i convert a string to Time ?
>
> Is there a function like "10/10/07 14:33:05".to_time ?
>
> The reason I need to do this is because I want to use the Time() methods
> such as asctime etc.
>> require ''time''
=> true>> Time.parse ''10/10/07 14:33:05''
=> Wed Oct 10 14:33:05 CDT 2007
Beware though:>> Time.parse ''Ruby on Rails''
=> Thu Dec 07 23:17:56 CST 2006
marcel
--
Marcel Molina Jr. <marcel-WRrfy3IlpWYdnm+yROfE0A@public.gmane.org>
--~--~---------~--~----~------------~-------~--~----~
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-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---