{
  "slug": "agent-timezone-and-deadline-errors",
  "title": "Why agents miss deadlines: timezone and window arithmetic",
  "description": "A language model has no clock. It also has no reliable intuition for whether an instant falls inside a window, which is how ship windows get missed with no error anywhere.",
  "keywords": [
    "agent timezone bug",
    "datetime now utc",
    "ship window",
    "late asn",
    "deadline calculation",
    "dst bug"
  ],
  "cause": [
    "A model cannot know the current time; anything it states is a guess anchored to its training data. That alone causes date arithmetic to be wrong in a way that looks confident.",
    "The subtler failure is window comparison. Code that compares a UTC timestamp against a local clock is off by the offset — in Tokyo that silently drops twelve hours of events every run, and nothing raises an error because both values are valid times.",
    "In retail EDI the same arithmetic decides whether an ASN is inside its window. Missing it is not an exception; it is a chargeback discovered later."
  ],
  "example": {
    "label": "Ask whether an instant fell inside a window, and by how much it missed",
    "curl": "curl -s 'https://fluentedi.com/v1/time/window?start=2026-08-01T00:00:00Z&end=2026-08-02T00:00:00Z&instant=2026-08-15T00:00:00Z'",
    "output": "\"position\": \"after\",\n\"verdict\": \"Missed — the window closed 1 week, 6 days ago.\",\n\"missed_by\": { \"humanized\": \"1 week, 6 days\" }"
  },
  "fix": [
    "Never let a model state the current time. Fetch it, with an explicit IANA zone.",
    "Compare instants, not wall clocks. Store and compare in UTC, convert only for display, and keep the offset in every serialised timestamp.",
    "Reversed window bounds are rejected outright rather than silently never matching — a window that can never match is the usual way this fails without an error."
  ],
  "tools": [
    "https://fluentedi.com/v1/time/window",
    "https://fluentedi.com/v1/time/now",
    "https://fluentedi.com/v1/time/convert",
    "https://fluentedi.com/v1/cron/next"
  ]
}