30.years.ago -> ok 40.years.ago -> error is it bug? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
On 15 Sep 2008, at 10:54, Pokkai Dokkai 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> > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
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 Cheung < frederick.cheung-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > > On 15 Sep 2008, at 10:54, Pokkai Dokkai 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 > > > > -- > > Posted via http://www.ruby-forum.com/. > > > > > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
RSL ___ wrote:> What version Rails are you using? > > On Mon, Sep 15, 2008 at 5:55 AM, Frederick Cheung <my os -windows-xp :: rails version 1.2.3 -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---