Different time transitions

The maximum precision of times in Ruby is in the nanosecond range. So 0.000000001 second. This is the same for Time, as for DateTime.
However, Ruby on Rails has a different understanding of the end of the day when it comes to the nanoseconds.

Times in Rails

Ruby on Rails has extended the time classes with useful functionalities. For example, end_of_day:

Therefore it is recommended to favor Time over DateTime when it comes to the end of day. Because according to DateTime a time between 23:59:59 and 24:00:00 is undefined: it is neither before the end of the day nor after the beginning of a day: