[SITE UNDER CONSTRUCTION AND TESTING.]

Speaking Display Clock

Important Updates

Click here to download the latest or any previous versions of the clock program and any other files.

  1. If you have downloaded my speaking display clock program (download link below) and run it but no 'pip' sounds were playing because the audio player could not find the 'pip' audio file (in which case, an error message to that effect should have appeared on the console the clock was running on), please download the 'pip' audio file by right-clicking here and selecting 'Save link as...' (or equivalent item) from the menu that appears. Make sure you put the file into the same folder on your computer that the other audio files you already have for the clock program are in. Apologies for any inconvenience; the problem was that an error occurred in producing the download zip file meaning that the 'pip' audio file was simply not included.

  2. I have noticed a bug: the program's calculating the upcoming time does not accommodate the fact of the switch between daylight saving time nor the reverting from it to standard time, resulting in the announcing of the switch times being incorrect. The UK's time of day is switched twice per year, from standard time to British Summer Time, in the spring, and back again, in the autumn, so only two announcements per year are affected.

    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. :)

  3. Another bug: there are such things as leap seconds. A leap second is occasionally added at the otherwise end of a year, so there is such a time as '23:59:60' on 31 December. This will result in an incorrect marking of the upcoming time by the pips, as follows:

    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.

Creative Commons Licence
Speaking Display Clock by Gary Hayward is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.