Code: Select all
if ( now < 1072224000 ) // 01.01.2004
(2004-1970)*365*24*60*60 = 1072224000
That is in fact 00:00:00 24 Dec 2003 UTC, not 00:00:00 1 Jan 2004 UTH.
00:00:00 1 Jan 2004 UTC is 1075593600.
I wouldn't bother normally, it's still a reasonable test for the clock having been set to a sensible value, but I want to use the same value as in dvbtime.cpp to test for the clock being set in fixes for bugs 588 & 589, and have a comment that refers back to dvbtime.cpp, like:
Code: Select all
if time() < 1072224000: # 01.01.2004, as in dvb/dvbtime.cpp
- propagate the incorrect comment (or Unix time value, depending on how you look at it);
- have the comment in the changes no longer match the code it refers back to;
- have the Unix time in the changes different from the dvbtime.cpp code, but still refer to the same date;
- fix the Unix time value to match the comment; or
- fix the comment to match the Unix time?
Norm Schryer wrote:When code and comments disagree, both are probably wrong.