DateTime and speed question

I recieve the following error at home and at work

irb(main):001:0> ri Time.parse
NoMethodError: undefined method `parse' for Time:Class
        from (irb):1

Charlie Bowman wrote:
> The Time class doesn't appear to have any methods to parse a string

into

> a time object or to find the difference of two times. How can this

be

···

On Tue, 2006-02-14 at 04:24 +0900, Mike Fletcher wrote:

> done without using the DateTime class?

ri Time.parse

freebie:~ 701> irb -r time
irb(main):001:0> Time.parse( "Mon Feb 13 14:22:10 EST 2006" )
=> Mon Feb 13 14:22:10 EST 2006
irb(main):002:0> t = Time.parse( "Mon Feb 13 14:22:10 EST 2006" )
=> Mon Feb 13 14:22:10 EST 2006
irb(main):003:0> t = t + 50
=> Mon Feb 13 14:23:00 EST 2006
irb(main):004:0> t = t + 3600
=> Mon Feb 13 15:23:00 EST 2006
irb(main):005:0> t_hour_later = t + 3600
=> Mon Feb 13 16:23:00 EST 2006
irb(main):006:0> t_hour_later - t
=> 3600.0

Start irb with -r time as was shown with the example, or require "time" once it is running.

James Edward Gray II

···

On Feb 13, 2006, at 1:42 PM, Charlie Bowman wrote:

I recieve the following error at home and at work

irb(main):001:0> ri Time.parse
NoMethodError: undefined method `parse' for Time:Class
        from (irb):1