How to Change the Time Zone in Snowflake
Snowflake allows you to set the time zone at the account or session level. This ensures that timestamps in queries and system views, such as those in the INFORMATION_SCHEMA, reflect the desired time zone.
1. Check the Current Account Time Zone
To determine the current time zone for your Snowflake account, use the following command:
SHOW PARAMETERS LIKE 'TIMEZONE';
This will return the current time zone set for your account, such as UTC or a specific region like America/Los_Angeles.
2. Change the Account Time Zone
If the time zone needs to be updated, you can change it by using the ALTER ACCOUNT command.
Syntax:
ALTER ACCOUNT SET TIMEZONE = '<desired_timezone>';
Examples:
To set the time zone to Europe/London:
ALTER ACCOUNT SET TIMEZONE = 'Europe/London';
To set the time zone to UTC+0:
ALTER ACCOUNT SET TIMEZONE = 'UTC+0';
To set the time zone to America/New_York:
ALTER ACCOUNT SET TIMEZONE = 'America/New_York';
💡 Note: You must have account admin privileges to modify the account-level time zone.
3. Verify the New Time Zone
Once the time zone has been updated, confirm the change by re-running the SHOW PARAMETERS command:
SHOW PARAMETERS LIKE 'TIMEZONE';
This will display the new time zone setting.
4. Set the Time Zone for a Session (Optional)
If you don’t want to change the time zone for the entire account, you can override it for your current session. This is especially useful for temporary or user-specific adjustments.
Syntax:
ALTER SESSION SET TIMEZONE = '<desired_timezone>';
Examples:
To set the session time zone to Europe/London:
ALTER SESSION SET TIMEZONE = 'Europe/London';
To set the session time zone to UTC-5:
ALTER SESSION SET TIMEZONE = 'UTC-5';
This setting only applies to the current session and will not affect other users or sessions.
5. Test the Configuration
To confirm that the time zone is correctly applied, run the following query:
SELECT CURRENT_TIMESTAMP;
This will return the current date and time in the time zone you have set.
6. Best Practices
• Use named time zones (e.g., Europe/London, America/New_York) for better clarity and alignment with daylight saving time rules.
• When adjusting the account time zone, ensure it aligns with the business or region where most users are located.