AI Trap of the Week · Context engineering · tricky
The "timezone-aware" fix that isn't
Customers in DST-affected timezones get invoiced on the wrong calendar day. You asked the AI to fix it. It produced this.
It explained: "Use setUTCDate to handle the customer timezone correctly."
export function nextBillingDate(c: Customer, after: Date): Date {
const next = new Date(after);
next.setUTCDate(c.billingDayOfMonth);
if (next <= after) {
next.setUTCMonth(next.getUTCMonth() + 1);
}
return next;
}Does this fix the timezone bug?
◆ Past traps
Review & hallucination · spotter
The flaky test "fix"
Try it →Review & hallucination · spotter
The plausible-looking pandas import
Try it →Tool / agent / security · spotter
The "safer" migration flag
Try it →