Bug in rails-1.2.3(number.years.ago)

30.years.ago -> ok
40.years.ago -> error
is it bug?

On 15 Sep 2008, at 10:54, Pokkai D. wrote:

30.years.ago -> ok
40.years.ago -> error
is it bug?

It’s because instance of Time on your machine can’t represent dates
before 1970

Fred

I’m surprised by this. Rails is usually smart enough to convert to
DateTime
where needed in these ActiveSupport time converting scenarios. From my
irb…

sneaky:~ rsl$ irb

ActiveSupport

=> ActiveSupport # Just to point out AS is loaded here

Time.now.class

=> Time

10.years.ago.class

=> Time

100.years.ago.class

=> Time

1000.years.ago.class

=> DateTime

What version Rails are you using?

RSL

On Mon, Sep 15, 2008 at 5:55 AM, Frederick C. <

RSL ___ wrote:

What version Rails are you using?

On Mon, Sep 15, 2008 at 5:55 AM, Frederick C. <

my os -windows-xp :: rails version 1.2.3