A clock that shows the correct time twice a day
A friend of mine told me that his ideal clock shows the correct time twice a day. We’ve all seen these clocks: a classic wrist watch that stopped ticking, or a church clock that doesn’t work anymore. Even though the clock stopped working, it still shows the correct time twice a day. Just for fun I decided to create one of these clocks and publish it on the internet. And then it became quite complicated.
The location of time
It is easy to create a physical clock in one location that shows the correct time twice a day. The time on the clock is related to the time zone where the clock and the person watching it are located. So if I decide to create a physical clock that always says that it is thirty seven minutes past one, it is correct twice a day.
If I publish this exact same clock on the internet, all of a sudden it is correct more than 24 times a day! That’s because now this clock shows the correct time twice per day in every single time zone. And there are more than 24 time zones. So a clock on the internet that shows the correct time just twice a day must be a completely different things than a clock that stopped ticking.
An online clock that shows the correct time only twice per 24 hours
The clock I built shows the correct time just twice every 24 hours, only to the first two people who visit it (or to the first two robots that visit it). So let’s say I visit this clock on 8:06, and I’m the first visitor, the clock says it’s 8:06. If the next person visits this clock at 8:07, the clock will say it is 8:07. Now if a third person visits the clock a few seconds later the clock will show a random time — well, not completely random: it will show a time that’s anything except 8:07. Everyone who visits the clock until 8:06 the next day will get an incorrect time.
The first two people who visit the clock 24 hours later will get to see the correct time again. So the clock doesn’t reset at midnight, because what’s midnight on the internet? It resets 24 hours after the first person saw the correct time.
Now there’s a last thing that I had to do to make sure that the correct time is only shown twice a day. Imagine that you are the third visitor of this day, and you visit this clock at 8:59. The clock might now pick 9:00 as a random incorrect time. Now if you wait one minute it will show you the correct time, right? And this would break the clock, because now it could actually show the correct time all the time. So I added a small script that refreshes the page every time a minute changes.
But is it accurate?
Without assumptions it is impossible to create this clock. The clock shows the time on your computer, so I have to assume that the time on the device that visits the clock is accurate. So yes, It is possible to break the main function of this clock by changing the time on your device. If you do so, and you visit the clock as one of the first two visitors of that day you will get the incorrect time, and when you visit it later that day there is a very low chance that you get to see the correct time.
Why does it look this way?
This clock has two different views. The first two visitors will see a style that’s based on the website of this friend of mine. He’s a scientist, so his design is trustworthy. The time is shown as follows: It is probably 09:03
, because the time it shows is based on assumptions.
The rest of the day you get a design that looks like ChatGPT, a chatbot that’s known to tell lies in a very convincing way. So now it will very convincingly tell you something like It’s precisely 13:29
, which is probably not true.
Another friend of mine wanted a clock that always says Right, it’s that time again!
(in Dutch). So I made that clock as well. Which was much easier.