Practical technical guides / Core IT: data engineering

Read Parquet Timestamps Correctly by Checking the UTC Adjustment Flag

Parquet marks a timestamp as an instant or a wall-clock value with one flag. Measured with pyarrow, pandas and DuckDB, including the day a report assigns.

By Sandeep Belgavi · Published 2026-12-02

Parquet marks a timestamp as an instant or a wall-clock value with one flag. Measured with pyarrow, pandas and DuckDB, including the day a report assigns.

Two kinds of timestamp share one physical type

A Parquet timestamp column is stored as a 64-bit integer: milliseconds, microseconds or nanoseconds since 1970-01-01 00:00:00. The integer alone does not say what that point in time means. The Parquet format answers that with one boolean in the logical type annotation, isAdjustedToUTC. The format specification describes the two cases. When it is true, the value is an instant: it was normalised to UTC when written, and readers should display it in whatever zone the reader chooses. When it is false, the value is a local date and time with no zone, sometimes called a wall-clock time: the same digits should be shown to every reader, whatever their zone.

Both are legitimate. An order placement time is an instant: it happened at one moment, and a team in another country should see it in their own time. A store's opening hour or a scheduled release at 09:00 local time is a wall-clock value: converting it to the reader's zone would be wrong. Problems start when a pipeline writes one kind and its readers assume the other, or when a step in the middle quietly converts between them.

Measured: what the writer stores and readers return

The local probe wrote one small Parquet file with pyarrow 26.0.1 and read it back with pyarrow, pandas 3.1.2 and DuckDB 2.0.1. It holds three synthetic Belgavi's Book Store orders placed in Kolkata at 23:45 on 30 November, 00:15 on 1 December and 09:30 on 1 December 2026. The same moments are written three ways: as a naive wall-clock value, as an instant with the Arrow zone UTC, and as an instant with the Arrow zone Asia/Kolkata.

ColumnArrow type writtenParquet annotationRead back by pyarrowDuckDB type
placed_localtimestamp in microseconds, no zoneisAdjustedToUTC=falseno zoneTIMESTAMP
placed_utctimestamp in microseconds, zone UTCisAdjustedToUTC=truezone UTCTIMESTAMP WITH TIME ZONE
placed_kolkatatimestamp in microseconds, zone Asia/KolkataisAdjustedToUTC=truezone Asia/KolkataTIMESTAMP WITH TIME ZONE

The Parquet annotation for placed_utc and placed_kolkata is identical. Parquet itself has no place for a zone name. The name Asia/Kolkata came back in pyarrow and pandas because pyarrow also stores the Arrow schema in the file metadata, and readers that understand that metadata restore it. DuckDB, which reads the Parquet annotation, returned both as TIMESTAMP WITH TIME ZONE and displayed them in its session zone. pandas gave datetime64[us], datetime64[us, UTC] and datetime64[us, Asia/Kolkata] respectively.

Whose day is it

The question that breaks reports is which calendar day an order belongs to. The probe ran the same DuckDB query under three session zones and cast each column to DATE.

Order placed in KolkataDate of placed_local in any sessionDate of placed_utc, session UTCSession Asia/KolkataSession America/New_York
30 Nov 23:452026-11-302026-11-302026-11-302026-11-30
1 Dec 00:152026-12-012026-11-302026-12-012026-11-30
1 Dec 09:302026-12-012026-12-012026-12-012026-11-30

The wall-clock column gives the same date everywhere: the digits are the digits. The instant column gives a date that depends on the reader's session zone, which is correct behaviour for an instant and a surprise for anyone who expected the store's local day. A daily sales report built from placed_utc on a server running in UTC counts order 5102 in November; the same report run by Reviewer B in Kolkata counts it in December. Both are right about different questions.

The worst case comes from a common pipeline step. Many extract jobs convert instants to UTC and then drop the zone, because the target column type is a plain timestamp or because an older library did not support zones. The probe wrote the same three orders that way: UTC wall-clock digits, isAdjustedToUTC=false. Read in a Kolkata session, order 5102 shows 2026-11-30 18:45:00 and its date is 30 November. Nothing in the file says the digits are UTC; a reader has no way to know, and the local day is wrong by one for every order placed between midnight and 05:30 Kolkata time.

Choose the type by meaning

The rule is short: choose the timestamp type from what the value means, and make that choice visible in the schema.

  • Events that happened at a moment, such as orders, payments and log records, are instants. Write them with a zone so the file carries isAdjustedToUTC=true.
  • Values that are meant to be read as local clock time everywhere, such as opening hours and scheduled local events, are wall-clock values. Write them without a zone, and keep the zone they belong to in a separate column if anyone will ever need the instant.
  • If a business day is defined in a particular zone, compute it explicitly in that zone and store it as its own DATE column, rather than leaving every reader to cast in their session zone.
import datetime as dt
import pyarrow as pa
import pyarrow.parquet as pq

def check_timestamp_columns(path: str, instants: set[str], wall_clock: set[str]) -> list[str]:
    """Fail when a column's Parquet annotation contradicts what it is documented to mean."""
    schema = pq.ParquetFile(path).metadata.schema
    problems = []
    for i in range(len(schema)):
        col = schema.column(i)
        text = str(col.logical_type)
        if not text.startswith("Timestamp("):
            continue
        adjusted = "isAdjustedToUTC=true" in text
        if col.name in instants and not adjusted:
            problems.append(f"{col.name}: documented as an instant but written without UTC adjustment")
        if col.name in wall_clock and adjusted:
            problems.append(f"{col.name}: documented as wall-clock but written as an instant")
    return problems

def business_day(instant: dt.datetime, zone: dt.tzinfo) -> dt.date:
    """The store's calendar day for an instant, computed in the store's zone."""
    return instant.astimezone(zone).date()

Run a check like this in the pipeline that produces the file, against a short list of columns and their intended meaning. It costs one metadata read and catches a writer change before readers see it.

Migration steps for an existing lake

  1. List every timestamp column in the tables that matter and read its annotation from the Parquet footers, not from the catalog. Catalogs and engines often normalise types on read.
  2. For each column, write down what it means, an instant or a wall-clock value, and, for instants stored without adjustment, which zone the digits are in. Usually this needs the people who own the source system.
  3. Fix writers first. New files should carry the right annotation from the next run onward.
  4. For historical files with UTC digits and no adjustment, either rewrite them with the right type or add a view that reinterprets the column explicitly in the known zone, and point readers at the view.
  5. Add a business day column computed in the business zone for any table that feeds daily reports.
  6. Set the session zone explicitly in scheduled jobs that cast instants to dates. A job that depends on the server's zone gives a different answer after a move to another region.

Failure modes

  • Mixed files in one table. A table whose older files are naive and newer files are adjusted reads inconsistently, and some engines refuse to union the two types. Check the footers of a sample across time, not just the newest file.
  • Zone names lost in transit. Readers that ignore Arrow metadata see only UTC. If the original zone matters for display, store it as a column.
  • Engines that pick a different default. Some engines read a naive Parquet timestamp as if it were UTC, others as local time, and some have options that change this. Test each engine your readers use against the same small file.
  • Precision changes. Older writers used INT96 for timestamps with nanosecond precision. INT96 has no isAdjustedToUTC flag at all, and engines interpret it by convention. Rewriting those files is the only fully reliable fix.
  • Daylight saving. Wall-clock values in zones with daylight saving have hours that occur twice or not at all. Converting them to instants needs a rule for those hours.

When this does not matter

If every writer and reader runs in UTC, every column is an instant, and every report defines days in UTC, the distinction never shows. Many internal analytics systems are like this. The question arises as soon as one reader works in another zone, a report needs a local business day, or a column that is really wall-clock time enters the lake.

How to verify it

The companion example parquet_timestamp_utc writes the file above with pinned versions of pyarrow, pandas and DuckDB, asserts the annotation of each column, runs the date query under the three session zones and asserts every cell in the table, and checks that the naive-UTC file reproduces the wrong day for order 5102. Copy the annotation check into your own writer tests.

Primary references and authorship

Sources checked 2026-12-02. Original explanation and synthetic examples by Sandeep Belgavi. Companion code: Sandeep-BA/agent-decision-lab/examples/python/parquet_timestamp_utc. Views are my own and do not represent any employer, past or present.