Skip to content

fix: Ensure timestamp returned from sessions estimate is in UTC#60502

Merged
tomasfarias merged 1 commit into
masterfrom
fix/ensure-timestamp-returned-from-sessions-model-is-in-UTC
May 28, 2026
Merged

fix: Ensure timestamp returned from sessions estimate is in UTC#60502
tomasfarias merged 1 commit into
masterfrom
fix/ensure-timestamp-returned-from-sessions-model-is-in-UTC

Conversation

@tomasfarias
Copy link
Copy Markdown
Contributor

@tomasfarias tomasfarias commented May 28, 2026

Problem

Sessions model uses HogQL which translates datetimes to timezones local to the user. This includes the datetime we get back when doing a backfill estimate. But we treat it as UTC in hourly/5 min exports.

Changes

Make sessions model always return a UTC datetime.

How did you test this code?

I haven't.

👉 Stay up-to-date with PostHog coding conventions for a smoother review.

Automatic notifications

  • Publish to changelog?
  • Alert Sales and Marketing teams?

Docs update

NO

🤖 Agent context

Nothing

@assign-reviewers-posthog assign-reviewers-posthog Bot requested a review from a team May 28, 2026 17:38
@tomasfarias tomasfarias added the stamphog Request AI review from stamphog label May 28, 2026
Copy link
Copy Markdown
Contributor

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trivial fix wrapping a ClickHouse timestamp expression with toTimeZone UTC — no logic change, no data model impact.

@greptile-apps
Copy link
Copy Markdown
Contributor

greptile-apps Bot commented May 28, 2026

Greptile encountered an error while reviewing this PR. Please reach out to support@greptile.com for assistance.

@tomasfarias tomasfarias enabled auto-merge (squash) May 28, 2026 17:49
@tomasfarias tomasfarias merged commit 132efc4 into master May 28, 2026
233 checks passed
@tomasfarias tomasfarias deleted the fix/ensure-timestamp-returned-from-sessions-model-is-in-UTC branch May 28, 2026 17:58
@deployment-status-posthog
Copy link
Copy Markdown

deployment-status-posthog Bot commented May 28, 2026

Deploy status

Environment Status Deployed At Workflow
dev ✅ Deployed 2026-05-28 18:40 UTC Run
prod-us ✅ Deployed 2026-05-28 19:10 UTC Run
prod-eu ✅ Deployed 2026-05-28 19:15 UTC Run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stamphog Request AI review from stamphog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant