4 ms·
Haha, should be 86400, not 84600.
by chubot 13y ago
Haha, should be 86400, not 84600.
- tshaddox 13y agoI liked this one: SECONDS_PER_23_5_HOURS = 84600
- markcarlson 13y agoThat is a very common value to use when you want something to either occur a bit more than once a day, or time out in a bit less than a day.
- underyx 13y agoAnd to keep the discussion interesting, also, 12 seconds is a pretty popular timespan to use when you want something longer than 10, but shorter than 15.
- nkozyra 13y agoI certainly have some code that adds 86399 to encompass the entirety of the day. This is in languages I use with less robust date logic, of course.
- ggreer 13y agoIf there was an 84600 with no hinting variable names nearby, anyone reading would have trouble figuring out the author's intention. Any other number (say... 81234) would be unambiguous. In the words of Douglas Crockford, "All that you know about the code is that the programmer was incompetent."
- CanSpice 13y agoExcept it shouldn't, because when you have a leap second occur, suddenly you're off by a second. A day is a day, it's not 86400 seconds.
- rossy 13y agoMost operating systems and frameworks don't expose the concept of leap seconds to user code. For example, Unix time is the number of seconds since the epoch ignoring leap seconds, so a program that compares timestamps generated by time() would be correct in assuming that a day is 86400 units of time_t.