Skip to content
Snippets Groups Projects
Unverified Commit 77d49e70 authored by bRong Njam's avatar bRong Njam Committed by GitHub
Browse files

Add timezone support (#4502)

This commit adds a `*time.Location` instance in both `frontend.Session` and `process.SessionInfo`, to store session level timezone info. We can use `set time_zone=XXX` to modify it. Three different formats are supported, the same as MySQL:

* set time_zone="SYSTEM". It sets timezone to your operating system's value, which is the default.
* set time_zone="+01:00". The timezone string specifies offset to UTC. It comprises a not omittable "+/-" sign, 2-digit hour, a ":" sign, and 2-digit minute. Legal values are between -13:59 and +14:00.
* set time_zone="America/New_York". The timezone string is a legal IANA TZ database name.

TIMESTAMP values are converted from the current time zone to UTC for storage, and back from UTC to the current time zone for retrieval. (This does not occur for other types such as DATETIME.)

Approved by: @daviszhen, @fengttt, @ouyuanning, @aptend, @aressu1985, @nnsgmsone
parent 9a451486
No related branches found
No related tags found
Showing
with 388 additions and 390 deletions
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment