Skip to content

gmail listings emit a naive "2026-07-28 03:36" date with no offset, derived from the sender's Date header #945

Description

@chrischall

gog gmail messages/threads JSON emits date in listDateLayout ("2006-01-02 15:04"), which carries no offset:

{ "id": "19fa6c3d5a030951", "date": "2026-07-28 03:36", "subject": "" }

A caller reading that has to already know which zone gog was configured for. Get it wrong and the value can land on the wrong calendar day, not merely the wrong hour — 2026-07-28 03:36 rendered in UTC is 2026-07-27 23:36 Eastern, a different date. That is the difference between "this went out Tuesday" and "this went out Monday night", which in a legal or scheduling record is the whole question.

This bit in practice on a headless deployment where nothing set GOG_TIMEZONE, so time.Local was UTC and the naive value silently meant UTC while every consumer read it as local.

Two things would fix it:

1. Carry an explicit offset. The compact date column is good for humans and should stay, but JSON consumers need an unambiguous value.

2. Prefer internalDate over the Date: header. formatGmailDateInLocation parses the header written by the sending client, which varies in format and offset and is occasionally just wrong. The Gmail API's internalDate is its own receipt timestamp (epoch ms, UTC) and is authoritative.

Proposal: add a dateIso field (RFC3339, from internalDate, rendered in the configured location) alongside the existing date, leaving current output and the human table untouched. Purely additive, so nothing that reads date today breaks.

Happy to send a PR — I have it implemented with tests.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Normal priority bug or improvement with limited blast radius.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.clawsweeper:needs-maintainer-reviewClawSweeper marked this issue as needing maintainer review before automation.clawsweeper:needs-product-decisionClawSweeper marked this issue as needing a product or behavior decision.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.impact:otherThis issue has meaningful maintainer-visible impact outside the owned taxonomy.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions