PostHog / posthog

🦔 PostHog provides open-source web & product analytics, session recording, feature flagging and A/B testing that you can self-host. Get started - free.
https://posthog.com
Other
22.33k stars 1.35k forks source link

fix: Use UTC timezone during conversion #26501

Closed rafaeelaudibert closed 3 days ago

rafaeelaudibert commented 3 days ago

HogQL is doing some internal magic and treating timestamps as if they are in the project's timezone versus UTC, so let's make it explicit

Does this work well for both Cloud and self-hosted?

Yes

How did you test this code?

Manual queries in prod showed me that we need to force the values to be in UTC because HogQL implicits make them behave as if they were in the project's timezone.

I didn't notice this problem locally because both my local and my test setup projects use UTC (as one always should), so it was always incorrect