If you look at the classes returned, returns a DateTime, while returns a Time --> DateTime --> Time

Not sure why that is the case, but obviously DateTime doesn't have a to_i method.


to_time() is a CoreExtensions method which uses Time::utc_time() ->
Time::time_with_datetime_fallback() from CoreExtensions to generate
the Time object. From the documentation:

Returns a new Time if requested year can be accommodated by Ruby‘s
Time class (i.e., if year is within either 1970..2038 or 1902..2038,
depending on system architecture); otherwise returns a DateTime

Because the year is out of range, you'll get a DateTime back, which
you can't call to_i on.

This is actually quite silly, when you think about it.