In message <[EMAIL PROTECTED]>, "Bill Hawk ins" writes: >Um, would you care to point out the more serious bugs?
1. Leap-seconds can happen at the end of any month. Preference is given to june+december and after that march+september. 2. Leap-seconds can add or delete a second. 3. You apply the leap second one second too early. 4. Your code does not work correctly if the system is not turned on at the moment of the leap-second. 5. Your code does not work unless somebody manually sets the leapsecond flag. 6a.Your code has no provision for recording and rendering a timestamp at an arbitrary time. or 6b.Your code has no provision for calculating a time interval from two timestamps spanning one or more leap-seconds. 7. Your code has no handling of setting/adjusting the clock across a leap-second. Poul-Henning >-----Original Message----- >From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] >Sent: Saturday, July 16, 2005 3:47 PM >To: [EMAIL PROTECTED]; Discussion of precise time and frequency measurement >Subject: Re: [time-nuts] Re: UTC - A Cautionary Tale > > >In message <[EMAIL PROTECTED]>, "Bill >Hawk >ins" writes: > >>Garbage is in the eye of the beholder. > >Indeed. > >That your "I'm gonna show those morons!!!" example contains serious >bugs in the leap second handling makes this one of my most treasured >emails in this entire debate. > >Welcome to category 3) Bill, now please don't waste more time. > >Poul-Henning > > >>/* Main Time Routine */ >> >>/* User must set a Leap Second switch when notified of same. */ >>/* Use a signed number for the switch if you think it will */ >>/* jump ahead one second. */ >> >>/* Handle one second interrupt */ >>UTC += 1; >> >>/* Handle Local Time from user-entered parameters, just like MS does */ >>Local Time = UTC + Local Time Offset; >> >>/* Handle leap second in UTC and local. Clock doesn't do 60 */ >>If Leap Second switch is set { >> If (UTC is 30 Jun 23:59:59 || UTC is 31 Dec 23:59:59) { >> Subtract leap second from UTC; >> Subtract Leap second from Local Time; >> Turn off leap second switch; >> } >>} >>/* Handle time shifts from user-entered parameters */ >>If Local Time matches Spring Ahead { >> Local Time += Spring Ahead Increment; >> Add one year to Spring Ahead; >>} >>If Local Time matches Fall Back { >> Local Time -= Spring Ahead Increment; >> Add one year to Fall Back; >> } >> >>/* End main time routine */ > >-- >Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 >[EMAIL PROTECTED] | TCP/IP since RFC 956 >FreeBSD committer | BSD since 4.3-tahoe >Never attribute to malice what can adequately be explained by incompetence. > > >_______________________________________________ >time-nuts mailing list >time-nuts@febo.com >https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts > -- Poul-Henning Kamp | UNIX since Zilog Zeus 3.20 [EMAIL PROTECTED] | TCP/IP since RFC 956 FreeBSD committer | BSD since 4.3-tahoe Never attribute to malice what can adequately be explained by incompetence. _______________________________________________ time-nuts mailing list time-nuts@febo.com https://www.febo.com/cgi-bin/mailman/listinfo/time-nuts