Skip to content

agenda --today uses UTC for day boundaries, wrong results in non-UTC timezones #259

@maximalmargin

Description

@maximalmargin

Bug

gws calendar +agenda --today uses UTC to determine day boundaries, so after ~4pm PST (midnight UTC), "today" returns tomorrow's events instead.

Repro

System timezone: PST (America/Los_Angeles)
System time: Thu Mar 5 20:20 PST 2026

$ gws calendar +agenda --today --calendar my-calendar@gmail.com
# Returns Mar 6 event (tomorrow), not Mar 5 (today)

$ gws calendar +agenda --tomorrow --calendar my-calendar@gmail.com
# Returns Mar 7 event (day after tomorrow)

The event timestamps in the output correctly show -08:00 (PST), but the day boundary calculation uses UTC.

Expected

--today, --tomorrow, and --days N should respect the system's local timezone (or the calendar's configured timezone) when computing which day it is.

Workaround

Using --days 2 and manually filtering results to the actual local date.

Environment

  • @googleworkspace/cli v0.4.1
  • macOS (Darwin 24.6.0)
  • Timezone: America/Los_Angeles (PST, UTC-8)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions