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
Visitor

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

Connect with Databricks Users in Your Area

Join a Regional User Group to connect with local Databricks users. Events will be happening in your city, and you wonโ€™t want to miss the chance to attend and share knowledge.

If there isnโ€™t a group near you, start one and help create a community that brings people together.

Request a New Group