Comment by ed25519FUUU
4 years ago
This is why it’s better to express time in seconds using multiplication. Easier to write, easier to review, and easier to change.
(60 * 60 * 24) // 1 day
(60 * 60 * 12) // 12 hours
(60 * 5) // 5 minutes
It's better yet to use a specific time or callendrical function if what you're accounting for is a specific clock or calendar interval.
Not all days have precisely 86,400 seconds.
For longer intervals, not all months have 28, 29, 30, 31, 30.43685, whatever, days. Not all years have 365 or 366 days, etc.
Pull out your copy of "Myths Programmers Believe About Time" and read it, hard. It will bite.