DateTime#to_f preserves fractional seconds

In Issue #15994, @xjlu points out that the to_f method strips the fractional seconds from the DateTime and always returns .0. [https://github.com/rails/rails/issues/15994]

Since @jeremy asked for a pull request with tests, here is the fix.