events.lat is a calendar of concerts and festivals across Latin America. Most of its listings come from ticketing APIs, and the biggest single source is the Ticketmaster Discovery API. Today 1,671 upcoming listings come from it, and 1,662 of those are in Mexico.
For a while, most of those listings showed the wrong day. The show was on Sunday, but the site said Monday.
The tell: matinees were right
The bug was spotted when an event page didn't match the seller. A closing concert was on Sunday 18 October at 19:00 in Guanajuato. Ticketmaster's own event URL said 18 October, and our page said the 19th.
A full count showed how big the problem was. 1,859 of 2,428 datable Ticketmaster rows were a day late. The 569 that were right were the afternoon shows. That pattern gave it away: only events late enough in the day to cross midnight in UTC were wrong.
Why
Discovery gives you two versions of the start:
"dates": { "start": { "localDate": "2026-10-18", "localTime": "19:00:00", "dateTime": "2026-10-19T01:00:00Z" } } dateTime is a UTC instant. Guanajuato is on UTC-6, so 19:00 there is 01:00Z the next day. Our events.event_date column is a plain Postgres date. Turning a UTC instant into a date keeps the UTC calendar day, which is the wrong day for anyone in the audience.
How many of today's listings would hit this? Of the 1,576 Mexican rows that have a start time, 1,199 start at 18:00 or later. At a venue on Mexico City time (UTC-6), every one of those is already the next day in UTC. So an evening concert calendar in the Americas is exactly where a date derived from UTC goes wrong.
There was a second, sneakier version. The old fallback used localDate but glued a fixed time onto it, T20:00:00Z, and parsed the result. 20:00 UTC is 14:00 in Mexico City. That looks safe until something converts it to a timezone of UTC-5 or further west and the day rolls over again.
The fix
Use localDate as the date, unchanged. Use dateTime only when there is no localDate, and in that case don't attach a time:
const localDate: string | null = e?.dates?.start?.localDate || null; const start = e?.dates?.start ?? {}; const localTime: string | null = !start.timeTBA && !start.noSpecificTime && /^\d{2}:\d{2}(:\d{2})?$/.test(start.localTime ?? "") ? start.localTime : null; const date = localDate || e?.dates?.start?.dateTime || null; if (!date) return null; return { // A bare YYYY-MM-DD goes in as-is; only the dateTime fallback needs parsing. event_date: localDate || new Date(date).toISOString(), // Only alongside localDate: a time next to a UTC-derived date would be wrong. start_time: localDate ? localTime : null, // ... }; Two details in that snippet matter.
timeTBA and noSpecificTime. Ticketmaster flags shows whose time hasn't been announced yet, and it can still send a placeholder localTime alongside the flag. If we stored that placeholder, the site would print a start time nobody had announced. Those rows keep start_time as NULL; today that's 86 of the 1,671.
No time next to a UTC-derived date. If we had to fall back to dateTime, the date is already suspect. Pairing it with a time would make it look more precise than it is.
The rule we ended up with: for anything a person attends, store the wall-clock date and time at the venue, as the venue states them. Keep UTC for things that happen to a machine, like a ticket sale opening at a fixed instant. A concert doesn't happen at an instant; it happens on a Sunday evening in Guanajuato.
A related bug: only the next two weeks
While fixing dates we found a second problem in the same function. The original fetch asked Discovery for sort=date,asc and stopped after 5 pages, which capped each country at its 500 soonest events.
In a market as busy as Mexico City, those 500 ran out after about a fortnight. 432 of 434 Mexican listings were inside 30 days, 96% inside 14, and nothing later was ever fetched. The calendar looked full, but it only reached two weeks ahead.
The fix was to slice the query by month:
url.searchParams.set("sort", "date,asc"); url.searchParams.set("startDateTime", tmDate(windowStart)); url.searchParams.set("endDateTime", tmDate(windowEnd)); Each one-month window gets its own page budget, so a busy fortnight can't push the rest of the year out of the results. Today the Ticketmaster rows run from this week to late April 2027.
A sneaky detail: Discovery wants YYYY-MM-DDTHH:mm:ssZ with no milliseconds, so toISOString() needs trimming:
function tmDate(d: Date): string { return d.toISOString().split(".")[0] + "Z"; } What about prices?
Some readers will ask, so here's the answer up front: none of those 1,671 Ticketmaster rows carries a price right now. The ingest stores priceRanges when Discovery sends it, and for these listings Discovery doesn't. Rather than print a number we can't stand behind, the site shows "See price on Ticketmaster" and leaves the price out of the structured data. A wrong price is worse than no price, for the same reason a wrong date is worse than "date TBA".
Checklist if you ingest event APIs
- Store the venue's local date. Don't derive it from a UTC instant.
- Treat "time TBA" flags as authoritative, even when a time field is present.
- Never attach a time to a date you derived from UTC.
- Check your data against the seller's own page. Here the seller's URL gave the bug away.
- If an API sorts by date and caps results, query date windows. Otherwise "the next N events" quietly becomes "the next two weeks".
The calendar is at events.lat.

