Skip to content

Table's metadata date time is in epoch seconds instead milliseconds #432

@orlevyhs

Description

@orlevyhs

What happened?

What happened?
I am running the emulator locally (observed on an ARM machine, though this likely applies generally) and querying table metadata.

When I request table details using the bq CLI pointing to the emulator, the timestamp fields (creationTime and lastModifiedTime) are returned in Unix seconds (10 digits).

Command executed:

Bash

bq --api http://0.0.0.0:9050 --project_id $project_id show --format=json $dataset.$table
Response received:
{
  "creationTime": "1767614463",
  "lastModifiedTime": "1767614463",
}

This causes a breaking issue when using the official Google Cloud BigQuery Go SDK. The SDK's table.Metadata() method expects these fields to be in Unix milliseconds.

Because the emulator provides seconds:

The SDK interprets 1767614463 as milliseconds.

This results in a timestamp of 1970-01-21 (approx 20 days past epoch) instead of the correct date in 2026.

What did you expect to happen?

I expected the emulator to return creationTime and lastModifiedTime in Unix milliseconds (13 digits), consistent with the real BigQuery API behavior.

The output should look like this:

{
  "creationTime": "1767614463000",
  "lastModifiedTime": "1767614463000",
  ...
}

This ensures that the Go SDK (and other clients expecting standard BigQuery API formats) can correctly parse the dates.

How can we reproduce it (as minimally and precisely as possible)?

Create a table and request using the bq client

Anything else we need to know?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions