At a K-12 online learning provider, 2025 to now
Messages that check their own times
Before every tutoring session, the student gets a message telling them the date and time. I wrote a program that drafts these messages and double-checks the time in the student's own time zone, so I never send a student the wrong hour.
- Role
- Built the program; I send every message myself
- Time
- October 2026 to now
- Tools
- Python
- Outcome
- Runs every weekday morning and afternoon; I read each draft and send it myself
Problem
I work at a K-12 online learning provider: schools in the US and abroad partner with us so their students can take courses online. I also tutor students one-to-one over video. For every session, the student gets two messages from me: one the day before, confirming the session is booked, and a reminder on the day. Each must give the date, the time and the student’s own time zone, because my students live in many different zones. If the hour is wrong, the student joins an empty room.
Constraints
- Messages go out only through the school’s own messaging system, and only when I send them. Nothing may send itself.
- Session times come from calendar invitations, and not every invitation includes the student’s local time.
- Clocks change in spring and autumn, and some students live where the clocks never change.
- A program that runs in the morning cannot know about sessions booked later that day.
What I built
A small Python program that drafts these messages for me. It reads my tutoring calendar and fills in the team’s standard confirmation and reminder wording for each session.
The tricky part is the time. The program copies the student’s local time from the calendar invitation, then works it out a second time on its own from the session’s start time in UTC (the world’s reference clock). If the two answers do not match, it flags the session instead of guessing. If an invitation has no local time, it uses a time zone already confirmed for that student, and labels every message that relied on it.
It also catches other problems: a missing video link, a session listed twice, or a student who is not on the invitation. It skips days off. On Fridays it covers the weekend and Monday. A second run in the afternoon drafts messages only for sessions booked since the morning, and suggests the exact time to schedule each reminder.
The diagram in words
- Calendar invitations, Calendar, Drafter.
- Confirmed zones and Days off, into Drafter.
- Four checks: Time matches; Date, time and zone present; No send path; Confirmed zone marked.
- Solid path: Drafts, Me, Messaging platform, Student.
- Dashed path from any check: Flag naming the session, then Me.
- Drafter to Messaging platform: "no send path".
How I proved it worked
Every batch of drafts must pass four automatic checks before it counts as ready:
- The date and time in each message match the calendar invitation.
- Every message includes a date, a time and a time zone.
- The program cannot send anything: there is no sending code anywhere in it.
- Every message that used a confirmed zone is labelled and names the zone.
A day with nothing to send only passes if every session is accounted for, one by one, so a quiet day cannot hide a missed session.
I replayed every change against earlier days. After adding the afternoon run, every earlier day but one produced exactly the same drafts, and that one differed on purpose. I also broke things deliberately: shifted an hour, removed a label, deleted a message, faked an “already handled” note. Each one made a check fail, and the failure named the message.
Outcome
- The program runs every weekday morning and afternoon. I read each draft and send it myself.
- When the clocks changed in November, the replays gave the right times, including for a place where the clocks never change.
- One real gap came to light: a session at the very start of my working day could not get its reminder in time, because I sent reminders by hand during the day. The afternoon run and the suggested send times came from that case.
- I do not claim an error rate, because none was measured.
What I would do next
- Read the sent messages back from the messaging system and compare them with the drafts.
- Add a check for the subject line. I once wrote a message by hand with the wrong subject, and nothing caught it.
The demo it pairs with
Time-zone message checker. Pick a session and see the confirmation in the student’s time zone. Then break it: change the zone, shift the hour or remove the time zone, and watch which check fails and why.
A made-up week of 7 tutoring sessions. The clocks went back in North America on the Sunday before. Pick a session to see its confirmation drafted in the student's own clock. Then break it, and watch which check fails and why.
Picking a session and breaking the draft need JavaScript. The first session's draft and its four checks read below without it.
Pick a session
The draft
- Stored
- Monday, 23:00 UTC
- The student's clock
- Monday, 6:00 p.m.
New York time (UTC-5) - The invitation
- Says Monday, 6:00 p.m.
Hi Pia,
Your tutoring session is booked.
Course: Chemistry
Day: Monday
Time: 6:00 p.m.
Time zone: New York time (UTC-5)
See you then.
Break it
The four checks
All four checks passed. The draft waits for a person to read it and send it.
1. The time matches the invitation
Passed. The message says Monday, 6:00 p.m. The invitation and the time worked out again from UTC agree.
2. It has a day, a time and a time zone
Passed. It gives Monday, 6:00 p.m. and the zone: New York.
3. Nothing can send it
Passed. There is no send button and no sending code. The draft waits for a person to read it and send it.
4. A zone on file is labelled and named
Passed. Not needed here: the invitation gave the local time, so no zone on file was used.