Feature #16745

Improving Date and DateTime comparison

Currently, when a Date and DateTime are compared, the Date is treated as a DateTime with time "00:00:00 +0000". This results in behavior which could be surprising when the other DateTime is not in UTC ("+0000"):

This last behavior leans on the idea that a Date is semantically a range of DateTimes, instead of a single DateTime with its time omitted. It would also cause (date <=> datetime) == 0 when (date === datetime) == true.

Of course, these changes may break backwards compatibility, and so they may not be feasible. But, related issues have been discussed in rails/rails#36462 and rails/rails#36579, and fixing this behavior in Ruby itself would solve them.