Closed LordSimal closed 3 months ago
This isn't true. Chronos extends DateTimeImmutable which implements DateTimeInterface.
https://github.com/cakephp/chronos/blob/3.x/src/Chronos.php#L62
but ChronosDate and ChronosTime dont.
Therefore Date and Time can't be compared to \DateTime instances anymore (and are now silently always returning false as can be seen in the linked discourse thread)
Only DateTime extends Chronos and can therefore be directly compared to a \DateTime instance
Ah ok. I misread Time as the previous Time/FrozenTime type which became DateTime which does implement DateTimeInterface.
I would omit the Time
type due to that confusion. We didn't have a time-only type before 5.0 and the previous Time type could be confusing.
true, I thought we had but i was wrong
Caused by https://discourse.cakephp.org/t/comparing-date-with-datetime-in-cake-5/12166/4