On 12 March 2010 09:27, Newb Newb <[email protected]> wrote: > Colin Law wrote: >> On 12 March 2010 09:00, Newb Newb <[email protected]> wrote: >>> i have a time field in my table. it is of varchar data type. >>> >>> i want compare the time between given times. >> >> As was previously suggested you should at least consider changing the >> data type of the field in the db. I did not see any comment from you >> on this suggestion in the previous thread. >> >> Colin > > now i m going to store the time 24 hour format... > > so is there any funtion to convert the 12hour time to 24 hours
You might be able to use DateTime.strptime to convert to DateTime which you can then convert to whatever format you want. See http://www.stephenchu.com/2007/11/parsing-time-in-custom-format-in-ruby.html for an example. Colin -- 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.

