Skip to main content

Timezone Settings

Omni can convert time-based data to different time zones, performing the conversion when it generates SQL for a query. The underlying data is not changed; rather the query results are converted using Omni's time zone settings. Note that if a user writes a raw SQL query with SQL Super Powers off, the timezone will not be converted.

There are two connection-level settings that specify how to convert time-based data:

  • Database Timezone: This tells us what timezone the user's database is in, and defaults to UTC. It will be used as the source timezone for any timezone conversions that take place.
  • Query Timezone: This is the timezone that the user wants to do their analysis in.
    • If specified, it will be set as the session timezone on the database connection, and any fields without timezone information (the name of these datatypes varies depending on the dialect) will be explicitly converted from the database timezone to the query timezone.
    • If not specified (currently the default "Do Not Convert" option in the dropdown), then the session timezone will be set to UTC, and no timezone conversion will take place.
    • This will impact filter UX in the app, for references to relative time and dates (today, yesterday, etc).
    • Right now query timezone cannot be set per user, so all users will query from the same global timezone for the purpose of filtering, etc.

If there is a field that you don't want us to convert timezones for, you can add the convert_tz: false property to the field in the model. Note that this only applies to fields without timezone information.

Snowflake note: if you specify a Query Timezone on the connection, then any timestamp_tz fields will be displayed in that timezone. Otherwise, they will keep their timezone offset as-is.