Click here to download the latest or any previous versions of the clock program and any other files.
Every ten seconds, at zero, ten, twenty, thirty, forty and fifty seconds past the minute, the program takes the current time and adds ten seconds to it to determine what the time will be then, which is the time to now be pre-announced. However, this means that if the time of day being pre-announced changes, the announcement will be wrong. Example:
Time of Day (HH:MM:SS) | Announcement | Notes |
---|---|---|
00:59:51 | "At the third stroke [pip], it will be one o'clock precisely" | UK standard time (GMT) |
00:59:58 | First pip | UK standard time (GMT) |
00:59:59 | Second pip | UK standard time (GMT) |
02:00:00 | Third and final pip | UK DST (BST) begins; time of day advances one hour |
As you can see, the announcement is wrong; the pre-announcement calculation could not possibly account for what a future time might actually be.
The solution is to add some extra code to the program. The code will need to include the dates and times at which, each year, for the country which time the program is being used to announce, daylight saving time begins and when standard time is reverted to. The program can then check the current date to see if it matches the date of the change date and, if it does, ten seconds before the change is to occur, add/subtract the DST offset—one hour—to/from the current time.
I'll get round to it.
Eventually. :)
Time of Day (HH:MM:SS) | Announcement | Notes |
---|---|---|
23:59:51 | "At the third stroke [pip], it will be twelve o'clock precisely" | Incorrect: it will be twelve o'clock precisely at the fourth stroke [pip] |
23:59:58 | First pip | |
23:59:59 | Second pip | |
23:59:60 | Third pip | |
00:00:00 | Fourth and final pip |
The clock program plays a pip sound if the final digit of the seconds value is either an eight, nine or zero. Two ways to solve the problem: It's 31 December of a year to which a leap second is to be added: 1: Simply include an additional "At the third stroke, it will be" announcement file, with the word "third" replaced with the word "fourth". I consider that, however, to be unsuitable on account of breaking with the three-pips format. 2, preferred: Simply exclude eight from the okay-to-pip seconds value final digits list.
But there's an annoying problem, whichever method is chosen, similar to but worse than the DST issue, above: There is no pattern to the years in which a leap second is added. If it is determined that one is needed at the end of a particular year, scientists announce it "about six months in advance"*. So anyone running this clock program would need to be aware of whether a leap second is to be added to the current year and provide this clock program with a notification to that effect. Not very convenient (the method of notifying is trivial, by the way). Apparently, a decision has been made to abandon the adding of leap seconds, by 2035—that's a long time away at time of writing (2023)—replacing the scheme with a better alternative; *read about it here.
Speaking Display Clock by Gary Hayward
is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.