Agent workflows
Which Day Did It Happen? Give Your Data Agent a Timezone Policy
Separate source clock time, UTC instants and business dates before grouping events. Keep DST uncertainty visible instead of letting a reporting agent silently move transactions.
A daily report can preserve every row and still put revenue on the wrong day. The agent did not lose a transaction; it interpreted the timestamp differently from the business team.
This problem appears when a report combines a UTC event log, a store export containing local clock times, and a spreadsheet whose date column already represents an accounting day. Those are three different inputs, even when their cells look similar.
For teams delegating recurring analytics to an agent, the useful instruction is not simply “fix the timezone.” It is a policy that explains which timestamps describe an instant, which require interpretation, and which should remain dates.
Methodology and scope
We reviewed pandas documentation for timezone localization and conversion, plus Python's zoneinfo reference, on September 24, 2026. This is a proposed reporting workflow, not a benchmark or a tested implementation. No customer dataset was inspected.
The selection criterion was a specific failure boundary: turning event records into daily groups. This differs from checking CSV types or scheduling a recurring calendar event. The intended reader is a developer or analyst who must explain why a transaction belongs to a particular reporting day.
Classify the input before transforming it
Ask the producer what each time field means. Our recommended intake note records the raw field, an example, its source system, and one of four meanings:
- An instant with a documented offset or UTC convention.
- A local clock reading with a documented named timezone.
- A local clock reading whose timezone is unknown.
- A business date that is not intended to encode an instant.
Do not fill the third category using the agent's machine timezone. Do not turn the fourth into midnight UTC merely because a datetime column is convenient. Both choices introduce meaning that the producer may never have intended.
Keep the original text and record identifier beside derived values. If the producer later clarifies the convention, the correction should be reproducible without requesting another export or trying to reconstruct discarded text.
Localization and conversion answer different questions
In pandas, tz_localize makes a timezone-naive index timezone-aware without converting its displayed clock time. It also exposes explicit handling for ambiguous and nonexistent local times. pandas localization reference.
By contrast, tz_convert operates on an already timezone-aware index and changes its timezone representation. Passing None converts to UTC before removing timezone information; that is not the same as preserving a local clock display. pandas conversion reference.
Our decision rule is therefore: establish the source interpretation first, preserve a normalized instant where one is justified, and derive the reporting view separately. Removing timezone information should be an explicit export decision, not a shortcut for making two columns join.
For an event already identified as an instant, keep its identity stable while producing the local representation required by the report. If two representations refer to the same event, a timezone change must not manufacture a second transaction.
Make uncertainty a visible output
A repeated clock hour creates a problem that a plausible-looking timestamp cannot resolve alone. Python's zoneinfo documents fold values for distinguishing the before-transition and after-transition offsets during ambiguous times. The library uses system timezone data or the first-party tzdata package when available. Python zoneinfo reference.
Our recommended exception ledger has five fields: record ID, original value, proposed timezone, unresolved question, and disposition. A disposition might be “awaiting producer clarification” rather than a fabricated instant.
An agent should not select a transition side, shift a nonexistent clock reading, or discard an uncertain row merely to finish the chart. Require an approved rule and record which records it affected. If uncertainty remains, publish a clearly qualified partial report or stop the normal release, depending on the report's requirements.
Also record the processing environment and timezone-data source. That gives a later reviewer somewhere concrete to look if the same input is interpreted differently after an environment change.
Derive the business day before aggregating
Define the reporting calendar with the data owner. Is the day based on headquarters time, each store's local time, or a business cutoff that is not midnight? Which field decides the store or region? What happens when that mapping is missing?
Then derive the business-date key for each eligible event and aggregate by that key. Do not group into UTC dates first and merely relabel the resulting chart with a local timezone. Once records have been combined into the wrong daily buckets, changing the axis label does not repartition them.
Keep the event-to-date mapping as an intermediate artifact. For a disputed total, the reviewer can inspect a handful of boundary records rather than asking the agent to explain an entire dashboard from memory.
Use a boundary fixture, not only a grand total
Before adopting a skill, prepare a small non-sensitive dataset with expected outcomes written by the data owner. Include these cases:
- Events just before and after the agreed reporting cutoff.
- Two offset-bearing representations of the same instant.
- A local reading in a repeated hour, with and without disambiguating evidence.
- A reading in a skipped local interval.
- An unknown timezone and a genuine business-date-only record.
These are proposed checks; we did not execute this fixture. Its acceptance criteria should include correct daily assignment, explicit unresolved cases, and preservation of the original records.
Reconcile the all-period population as well as each daily bucket. A correct grand total is necessary for many reports, but it cannot detect a transaction shifted from Tuesday to Wednesday. Also inspect the narrative: a daily increase near a boundary correction is not automatically evidence of business growth.
Limitations and the handoff
This procedure cannot recover missing source meaning or prove that the upstream system recorded the correct time. A named timezone does not settle accounting policy, and a technically valid conversion cannot decide which regional calendar management intended.
Deliver the source-field definitions, reporting calendar, exception count, affected-record mapping and environment note alongside the chart. Keep sensitive samples out of public logs.
Use our CSV reconciliation guide for the earlier ingestion stage. When browsing the skill directory, ask candidates to demonstrate this boundary fixture before choosing their chart style. The question is not whether the date column looks tidy. It is whether the reporting day means what the business thinks it means.