Help in changing string format

I need some help in converting this date time format to the one
time.parse will accept.

irb(main):039:0> time=“31/12/2007 5:00:00 PM”
=> “31/12/2007 5:00:00 PM”
irb(main):040:0> Time.parse(time)
ArgumentError: argument out of range
from e:/ruby/lib/ruby/1.8/time.rb:184:in local' from e:/ruby/lib/ruby/1.8/time.rb:184:inmake_time’
from e:/ruby/lib/ruby/1.8/time.rb:243:in `parse’
from (irb):40
from ¢¾:0

apprecaite ur help.

seede

Junkone wrote:

I need some help in converting this date time format to the one
time.parse will accept.

irb(main):039:0> time=“31/12/2007 5:00:00 PM”

Replace the slashes with dashes.

HTH,
Sebastian

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs