by Matt Sowa
Time zones in booking systems: six rules that prevent wrong bookings
A customer in Tokyo books a call for 3 PM. The therapist is in Berlin. Which 3 PM is it?
If the booking system cannot answer that from its own data, it has a time zone bug. Nobody sees it until someone waits alone on a call, or two people turn up for one slot. When an AI agent makes the booking, there is no person in between to notice the mistake.
Update, October 2026. We first wrote this post about the API of the Timerise platform, the hosted booking product we ran from 2021 to 2025. Today we build booking systems that our clients own, so the post now gives the rules we build by. They come from those platform years, and they are the same rules our Agent Skills teach a coding agent.
Why time zones break bookings
"3 PM" means nothing without a place. And the gap between two places is not fixed:
- Clocks change on different days. In 2026, the US moved its clocks forward on 8 March and Europe on 29 March. For those three weeks, New York was five hours behind Warsaw, not six. On 25 October 2026, Europe moves back, and the US follows on 1 November.
- Some local times do not exist. In Warsaw on 29 March 2026, the clock jumped from 02:00 to 03:00. A slot at 02:30 that day is not a real time.
- Some local times happen twice. On 25 October 2026, 02:30 comes twice in Warsaw: once before the clocks go back, once after.
- Rules change. Governments change daylight saving rules, sometimes with only a few weeks' notice.
A booking system that does not plan for this moves bookings by an hour, shows a slot that cannot be booked, or puts a class on the wrong day.
Rule 1: store instants in UTC, keep the zone next to them
Every booked time goes into the database as an instant in UTC. Next to it, the system keeps the zone the time belongs to, such as the location's or the host's.
Use IANA zone names, like Europe/Warsaw or America/New_York. Do not use abbreviations like "CET" or "EST". They do not say whether summer time applies, and some of them mean different things in different countries. A fixed offset such as +01:00 is not a zone either: it is right for half of the year.
Convert to local time only when you show the time to a person.
Rule 2: write rules in local time, and pin the zone
Opening hours are local. "Open from 09:00" means 09:00 in the shop, in winter and in summer. So the rules that create slots are written in local time, and each rule carries its own zone.
Fix that zone when the rule is created. If a business later changes its main zone, existing slots and bookings must not move. A booking made for 09:00 stays at 09:00.
Rule 3: count local days, never add 24 hours
This is the most common bug we see in slot code:
// Wrong: a day is not always 24 hours
const nextDay = new Date(start.getTime() + 24 * 60 * 60 * 1000);On the day the clocks change, a local day has 23 or 25 hours. Take 23:30 on the evening before a spring change and add 24 hours: you get 00:30 on the day after the change. Add it to 09:00 and the slot moves to 08:00 or 10:00.
Count calendar dates instead, and turn each date and local time into an instant with the zone:
import { fromZonedTime } from "date-fns-tz";
// datesBetween is your own helper: it returns "2026-03-28", "2026-03-29", ...
// counted as calendar dates, not as hours
for (const date of datesBetween("2026-03-28", "2026-04-03")) {
const start = fromZonedTime(`${date}T09:00`, "Europe/Warsaw");
// start is a UTC instant: 08:00Z before 29 March, 07:00Z from 29 March
}Then decide what happens to the times that do not exist or happen twice. A slot at 02:30 on a spring change day can be skipped or moved to 03:00. On an autumn change day, pick the first 02:30 or the second, and use the same choice everywhere. Write the choice down and test it.
Rule 4: the server's time zone must not matter
Code that works on a developer's laptop in Warsaw can break on a server in UTC, and the other way round. Two common traps:
new Date("2026-03-29T09:00")reads the time in the server's zone, not the business's zone.getUTCDay()gives the weekday in UTC. For a Monday 08:00 slot in Auckland, that is Sunday evening. Far from UTC, the slot ends up on the wrong day.
Always pass the zone yourself, with the Intl API or a library such as date-fns-tz. Then prove it: run the same tests under several process time zones.
for tz in UTC Europe/Warsaw America/Los_Angeles Pacific/Auckland; do
TZ=$tz npm test || exit 1
doneAdd a test for each clock change you care about. Add one for a place that is a long way from UTC, such as Auckland. And add one for Lord Howe Island in Australia, where the clocks move by 30 minutes, not an hour.
Rule 5: show times in the customer's zone too
The browser knows the visitor's zone:
const visitorZone = Intl.DateTimeFormat().resolvedOptions().timeZone;
// e.g. "Asia/Tokyo"Use it to show times, never to decide them. The slot belongs to the business's zone. When the visitor is somewhere else, show both:
Session: 8:00 AM Berlin time (4:00 PM your time)
Save the visitor's zone with the booking, so the confirmation and the reminders use the same times the customer saw. And if an old booking has no zone, fall back to the UTC instant, not to the server's zone.
Rule 6: give AI agents times they cannot misread
An AI agent reads exactly what the API returns. It cannot guess the zone from context the way a person can. So the API should leave nothing to guess:
- Every time in a response comes twice: the UTC instant for logic, and the local time with its offset for display. On the platform, these were two fields:
2026-02-16T19:43:29Zand2026-02-16T20:43:29+01:00. - The zone is named: the response says
Europe/Warsaw, not only+01:00. - Input accepts an offset or a zone: the agent can send
2026-03-15T09:00:00+01:00as the customer said it, and the server converts it. - The check happens on the server: when the agent books, the server checks the slot again with the same function that listed it. If the time is no longer free, the agent gets a clear error, not a booking at a different time.
That last rule matters for people too. In our skills, the page and the booking use one function, so a slot that was on the screen is still bookable when the customer presses the button. The systems we build come with their own API, and can include an MCP server, so agents book under the same rules. How AI agents find your services covers the rest of what an agent needs.
Where these rules live
These rules are part of three of our Agent Skills. A coding agent reads the skill before it writes the code, so it keeps the rules without being told:
time-slot-generatorcreates slots from rules: opening hours, classes on the first Monday of the month, overnight slots. Its tests run under four process time zones.calendar-scheduling-linksbuilds booking pages for meetings, with calendar sync and reminders. We walk through it in Build your own Calendly with an Agent Skill.bookable-eventshandles paid events and deposits, with each event's time zone and currency.
For the other parts of a booking system, see How to build a booking system. If you would rather have us build it, send a brief. You get a system you own, for a fixed price.
Talk to us about your booking system
No sales script. Tell us what you are building, and we will tell you how we would build it.