📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

TIMEZONE



Returns the timezone for the current connection.

TiDB Cloud Lake uses UTC (Coordinated Universal Time) as the default timezone and allows you to change the timezone to your current geographic location. For the available values you can assign to the timezone setting, refer to https://docs.rs/chrono-tz/latest/chrono_tz/enum.Tz.html. See the examples below for details.

Syntax

SELECT TIMEZONE();

Examples

-- Return the current timezone SELECT TIMEZONE(); ┌────────────┐ │ timezone() │ ├────────────┤ │ UTC │ └────────────┘ -- Set the timezone to China Standard Time SET timezone='Asia/Shanghai'; SELECT TIMEZONE(); ┌───────────────┐ │ timezone() │ ├───────────────┤ │ Asia/Shanghai │ └───────────────┘

Was this page helpful?