Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
Alex Gleason (alex@gleasonator.com)'s status on Thursday, 27-Jul-2023 06:59:32 JSTAlex Gleason Why, javascript... why can I compare dates by their unix timestamp when I used the gt and lt operators, but not equal...
> new Date('2023-01-01T00:00:00Z') > new Date('2000-01-01T00:00:00Z')
true
> new Date('2023-01-01T00:00:00Z') < new Date('2000-01-01T00:00:00Z')
false
> new Date('2023-01-01T00:00:00Z') == new Date('2023-01-01T00:00:00Z')
false
https://stackoverflow.com/a/493018/8811886