This returns 1
(aka TRUE
)
SELECT DATE_SUB(NOW(), INTERVAL 24*100 HOUR) = DATE_SUB(NOW(), INTERVAL 100 DAY);
100 days ago, the hour of day does not change. But due to Daylight Savings Time (US), 100 twenty-four hour periods ago is actually one hour earlier than if you counted by days. If the above statement accounted for DST, it would return 0
or FALSE
.
Is there a way I can say to account for DST for a given statement or session? I would prefer not to use UNIX_TIMESTAMP
since it cuts off anything past 2038.