## Usage

```
view: view_name {
  dimension: field_name {
    convert_tz: yes | no
  }
}
```

|---|---|
| Hierarchy [View File](https://docs.cloud.google.com/looker/docs/reference/param-view.md.txt) [`view`](https://docs.cloud.google.com/looker/docs/reference/param-view-view.md.txt) [Field Type](https://docs.cloud.google.com/looker/docs/reference/param-field.md.txt) `convert_tz` | Possible Field Types Dimension, Dimension Group, Measure, Filter, Parameter <br /> Accepts A Boolean (yes or no) <br /> |

## Definition

Looker has various [time zone settings](https://docs.cloud.google.com/looker/docs/using-time-zone-settings.md.txt) that convert time-based data between different time zones. Looker does time zone conversion by default. If you don't want Looker to perform a time zone conversion for a particular [`dimension`](https://docs.cloud.google.com/looker/docs/reference/param-field-dimension.md.txt), [`dimension_group`](https://docs.cloud.google.com/looker/docs/reference/param-field-dimension-group.md.txt) (with [`type: time`](https://docs.cloud.google.com/looker/docs/reference/param-field-dimension-group.md.txt#type_time)), or [`filter` field](https://docs.cloud.google.com/looker/docs/reference/param-field-filter.md.txt), then you can use the `convert_tz` parameter. This parameter can be useful for fields that are already converted to the appropriate time zone, or in some advanced situations where you need to avoid a double time zone conversion.

In general, time computations (differences, durations, etc.) only work correctly when you operate on time values that are all converted to the same time zone. It is important to keep time zones in mind when writing LookML.

## Examples

Don't perform time zone conversion for the `local_created` dimension group:

    dimension_group: local_created {
      type: time
      timeframes: [time, date, week, month]
      sql: ${TABLE}.local_created_at ;;
      convert_tz: no
    }

## Things to consider

`convert_tz: no` applies only to a dimension, not to a filter that uses the dimension. In other words, filters *always* perform time zone conversion. When you specify `convert_tz: no`, time-based data values are displayed in the [database time zone](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#database_time_zone), but are filtered using the [query time zone](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#query_time_zone).

Because filters always do time zone conversion, a difference between the database time zone and query time zone could cause data to unexpectedly be included or excluded from a dataset. To avoid this, ensure that the query time zone is set to the same value as the database time zone.

If [**User Specific Time Zones**](https://docs.cloud.google.com/looker/docs/using-time-zone-settings.md.txt#user_specific_time_zones) is enabled, set the time zone drop-down menu (located next to the **Run** button on Explores, Looks, and dashboards) to the same value as the database time zone. If **User Specific Time Zones** is disabled, set the [**Query Time Zone**](https://docs.cloud.google.com/looker/docs/connecting-to-your-db.md.txt#query_time_zone) to the same value as the database time zone.

If you're using [custom filters](https://docs.cloud.google.com/looker/docs/filtering-and-limiting.md.txt#custom_filters), keep time zone conversion enabled to ensure valid date comparisons. If you turn off time zone conversion with `convert_tz: no` and include the field in a custom filter, your date comparisons may be invalid.

## Database dialect support for time zone conversion

For Looker to convert time zones in your Looker project, your database dialect must support time zone conversion. The following table shows which dialects support time zone conversion in the latest release of Looker:

| Dialect | Supported? |
|---|---|
| Actian Avalanche | No |
| Amazon Athena | Yes |
| Amazon Aurora MySQL | Yes |
| Amazon Redshift | Yes |
| Amazon Redshift 2.1+ | Yes |
| Amazon Redshift Serverless 2.1+ | Yes |
| Apache Druid | No |
| Apache Druid 0.13.x - 0.17.x | Yes |
| Apache Druid 0.18+ | Yes |
| Apache Hive 2.3+ | Yes |
| Apache Hive 3.1.2+ | Yes |
| Apache Spark 3+ | Yes |
| ClickHouse | No |
| ClickHouse 26+ | No |
| Cloudera Impala 3.1+ | Yes |
| Cloudera Impala 3.1+ with Native Driver | Yes |
| Cloudera Impala with Native Driver | Yes |
| DataVirtuality | No |
| Databricks | Yes |
| Denodo 7 | No |
| Denodo 8 \& 9 | No |
| Dremio | Yes |
| Dremio 11+ | Yes |
| Dremio 26+ with Arrow Flight SQL | Yes |
| Exasol | No |
| Google BigQuery Legacy SQL | No |
| Google BigQuery Standard SQL | Yes |
| Google Cloud AlloyDB for PostgreSQL | Yes |
| Google Cloud PostgreSQL | Yes |
| Google Cloud SQL | Yes |
| Google Spanner | Yes |
| Greenplum | Yes |
| HyperSQL | No |
| IBM Netezza | Yes |
| MariaDB | Yes |
| Microsoft Azure PostgreSQL | Yes |
| Microsoft Azure SQL Database | Yes |
| Microsoft Azure Synapse Analytics | Yes |
| Microsoft SQL Server 2008+ | No |
| Microsoft SQL Server 2012+ | No |
| Microsoft SQL Server 2016 | Yes |
| Microsoft SQL Server 2017+ | Yes |
| MongoBI | No |
| MongoSQL | No |
| MySQL | Yes |
| MySQL 8.0.12+ | Yes |
| Oracle | Yes |
| Oracle ADWC | Yes |
| PostgreSQL 9.5+ | Yes |
| PostgreSQL pre-9.5 | Yes |
| PrestoDB | Yes |
| PrestoSQL | Yes |
| SAP HANA | No |
| SAP HANA 2+ | No |
| SingleStore | Yes |
| SingleStore 7+ | Yes |
| Snowflake | Yes |
| Teradata | No |
| Trino | Yes |
| Vector | No |
| Vertica | Yes |