cancel
Showing results for 
Search instead for 
Did you mean: 
Warehousing & Analytics
Engage in discussions on data warehousing, analytics, and BI solutions within the Databricks Community. Share insights, tips, and best practices for leveraging data for informed decision-making.
cancel
Showing results for 
Search instead for 
Did you mean: 

User default timezone (SQL)

aburkh
New Contributor

Users get confused when querying data with timestamps because UTC is not intuitive for many. It is possible to set TIME ZONE at query level or at SQL Warehouse level, but those options fail to address the need of multiple users working on the same warehouse in different timezones.

Would it be possible to set user-level time zone preferences, that would apply to all their SQL queries?

1 REPLY 1

Alberto_Umana
Databricks Employee
Databricks Employee

it is possible to set the time zone at the session level using the SET TIME ZONE statement in Databricks SQL. This allows users to control the local timezone used for timestamp operations within their session. However, there is no direct option of user-level time zone preferences that would apply to all their SQL queries across different sessions.

Here are the relevant details:

  1. Session-Level Time Zone Setting: You can set the time zone for a session using the SET TIME ZONE statement. This setting will apply to all timestamp operations within that session.
    • Example:

SET TIME ZONE = 'America/Los_Angeles';

SELECT current_timezone();  -- Returns 'America/Los_Angeles'

You can review this: https://docs.databricks.com/en/sql/language-manual/parameters/timezone.html

Join Us as a Local Community Builder!

Passionate about hosting events and connecting people? Help us grow a vibrant local community—sign up today to get started!

Sign Up Now