Data Engineering

Midnight in Which Time Zone? A Checklist for Daily Data Reports

Huwell Consultancy editorial2 min read

Two reports can disagree about “yesterday” even when they use the same events. One may use UTC dates while the other uses a local calendar day. Before investigating a Malta reporting difference, confirm what the day actually means.

Write down the reporting rule

Ask which time zone defines the business day and whether the event time means creation, completion or receipt. These timestamps are not interchangeable. An event received after midnight may describe work completed earlier. Agree which meaning the report should follow before changing the query.

Understand the database type

PostgreSQL distinguishes timestamp without time zone from timestamp with time zone. Its documentation explains that values with a time zone are represented internally in UTC and displayed using the session time zone; the originally supplied zone is not retained. A timestamp without time zone does not provide that conversion behaviour. Do not assume that a column name ending in “utc” proves how values were stored.

Test the boundaries

  • An event just before the start of the reporting day.
  • An event exactly at the start.
  • An event just before the next day.
  • An event exactly at the next day’s start.

A start-inclusive, next-start-exclusive interval can make adjacent reporting periods easier to reason about. Calculate the boundaries for the agreed zone rather than assuming every local day has exactly the same duration.

Keep the rule with the report

Record the event field, time zone and boundary convention. Use a small approved sample to compare results. In an interview, explaining these assumptions shows why a correct-looking date filter can still answer the wrong business question.

Sources and further reading

Explore current technology jobs in Malta →

EXPLORE THE NEXT STEP

Discuss the work you want to do.

Browse current technology vacancies with Huwell Consultancy and ask us about the responsibilities that matter to you.

Explore opportunities
KEEP EXPLORING

More guidance for your next decision