The full answer
The two of you are cutting days at different midnights. Timestamps are stored as instants (in UTC), and grouping them by day depends on the time zone the query uses. If your session runs in UTC and theirs in New York time, sales between 00:00 and 05:00 UTC (the evening before in New York) land on different days. Each day moves a little, but the month total barely changes, apart from the first and last day.
How to confirm
SHOW TimeZone;
SELECT created_at,
created_at AT TIME ZONE 'UTC' AS utc_time,
created_at AT TIME ZONE 'America/New_York' AS ny_time
FROM orders
ORDER BY created_at DESC
LIMIT 5;
If the day in the two columns differs for evening orders, you have found it. Ask the other team what their session or BI tool uses.
The fix: name the business time zone in the query
Decide which time zone defines a "day" for the business (usually where the company reports, or each store's local time), and write it into the query instead of relying on session settings:
SELECT date_trunc('day', created_at, 'America/New_York') AS sales_day,
SUM(amount) AS revenue
FROM orders
WHERE created_at >= '2026-10-01 00:00 America/New_York'
AND created_at < '2026-11-01 00:00 America/New_York'
GROUP BY 1
ORDER BY 1;
Both the grouping and the filter use the same zone, so the first and last day of the month are complete. Using a named zone such as America/New_York rather than a fixed offset like -05 also handles daylight saving time, when the offset changes.
Related traps
timestampwithout time zone stores no zone at all. Find out what the loading process wrote into it (UTC or local time); you cannot tell from the data.- BI tools often apply their own time zone on top of the database. Check the setting in the tool, not only in SQL.
- Several regions: for "store day" reports, convert each sale with its store's own zone, kept in a column on the store.
Write it down
Put the reporting time zone in the metric definition, so every dashboard and team uses the same day boundary.
What interviewers want: understanding that a day depends on a time zone, checking the session setting, putting the business time zone explicitly in both the grouping and the filter, daylight saving, and agreeing the definition across teams.
Last updated 16 October 2026
Sources