My goal is to get a Time instance from a DateTime instance
This has been previously discussed here and I am still confused : Convert to/from DateTime and Time in Ruby
For me in irb running ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0], things work perfectly
1.9.3p0 :001 > require 'Date'
=> true
1.9.3p0 :002 > require 'Time'
=> true
1.9.3p0 :003 > t=DateTime.now
=> #<DateTime: 2012-07-01T01:57:32+05:30 ((2456109j,73652s,621060000n),+19800s,2299161j)>
1.9.3p0 :004 > t2=t.to_time
=> 2012-07-01 01:57:32 +0530
1.9.3p0 :005 > t.class
=> DateTime
1.9.3p0 :006 > t2.class
=> Time
1.9.3p0 :007 >
However when working with rails console v 3.2.3 on same ruby platform
1.9.3p0 :001 > t=DateTime.now
=> Sun, 01 Jul 2012 02:00:00 +0530
1.9.3p0 :002 > t.class
=> DateTime
1.9.3p0 :003 > t2=t.to_time
=> Sun, 01 Jul 2012 02:00:00 +0530
1.9.3p0 > t2.class
=> DateTime
What to do to get a Time instance from DateTime in rails?