> ## Content Index
> Fetch the complete content index at: https://desonalleyne.org/llms.txt
> Use this file to discover other available public pages before exploring further.

# I Bet You Don’t Know How to Read the Time
- URL: https://desonalleyne.org/i-bet-you-dont-know-how-to-read-the-time/
- Published: 2026-10-29T03:50:43.000Z
- Updated: 2026-10-29T03:50:43.000Z
- Description: “It’s 46 minutes to 11:57.” Quick, what time is it?
- Author: Deson Alleyne
- Tags: code, build log

Ask most people for the time and they’ll glance at their phone and tell you. Ask my brother, and you’ll get something like:

> **It’s 46 minutes to 11:57.**

Then he walks off while you do the maths.

He’d pick a random time somewhere in the near future or past, then add or subtract however many minutes it took to land on the actual time. Technically correct. Completely unhelpful. Every single time. Mental maths isn’t my strong suit, so I was always a little in awe of how quickly he could pull it off. I couldn’t do it in my head, but I figured I could teach a computer to.

### A real-world problem

One day I was bored, and it hit me: this is a perfectly good coding challenge. Most of us learn by building something from a real-world problem, and my brother had handed me one, even if the “problem” was mostly him.

So I built [**Broken Timebox**](https://broken-timebox.desonalleyne.org/?ref=desonalleyne.org). Load the page and it tells you the time, my brother’s way. Underneath, it shows the actual time, so you can check your maths.

Every refresh gives you a new puzzle.

### How it works

It’s simple under the hood: a small Flask app that does the following each time the page loads:

1. Gets the current time in Guyana.
2. Picks a random number of minutes.
3. Flips a coin: **to** or **past**.
4. Works backwards to the “broken” reference time.

“To” means the reference time is in the future, so the minutes get added. “Past” means it’s in the past, so they get subtracted. The fiddly part is when the minutes spill over the hour (or wrap past midnight), so the code has to carry the hour along with them:

```python
sides = ['to', 'past']
d = datetime.now(gyt_timezone)
min_delta = randint(lower_m_delta, upper_m_delta)
side_idx = randint(0, 1)
side = sides[side_idx]

hour = d.hour
minute = d.minute

if side_idx == 0:
    minute = minute + min_delta
    if minute > 59:
        hour = (hour + (minute / 60)) % 24
        minute = minute % 60
else:
    minute = minute - min_delta
    if minute < 0:
        hour = (hour + (minute / 60)) % 24
        minute = minute % 60
```

### Looking back

I built this a few years ago, and reading the code now, I can see past me working hard. The hour maths uses regular division (`/`), which produces decimals, and then quietly relies on `int()` chopping them off at the end. It works, even across midnight, but it works a bit by accident.

Today I’d let Python’s `datetime` do the heavy lifting:

```python
from datetime import timedelta

delta = timedelta(minutes=min_delta)
broken = d + delta if side == 'to' else d - delta
```

Same result, two lines, and no midnight edge cases to worry about. That’s the fun of revisiting old projects: the joke still holds up, and you get to see how far you’ve come.

### Try it

Head to [**broken-timebox.desonalleyne.org**](https://broken-timebox.desonalleyne.org/?ref=desonalleyne.org) and see how fast you can work out the time. Then go ask someone in your family what time it is, and appreciate them a little more.