Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 26 Mar 2021 22:32:25 -0600
From:      Gary Aitken <>
To:        Bruce Ferrell <>,
Subject:   Re: mysql time-zone ambiguity?
Message-ID:  <>
In-Reply-To: <>
References:  <> <> <> <>

Next in thread | Previous in thread | Raw E-Mail | Index | Archive | Help
On 3/26/21 12:11 PM, Bruce Ferrell wrote:
> On 3/26/21 10:39 AM, Gary Aitken wrote:
>> I read that but thought (and still think) it should happen by default.
>> Why doesn't the default installation process load the time zone tables?
>> The default installation results in mysql setting the time to "SYSTEM",
>> with or without the time zone tables loaded.
>> Since the system appears to be returning the time "MDT", which mysql
>> doesn't understand, it seems to me there is something wrong with the
>> mysql_tzinfo_to_sql translation or the zoneinfo or both.
>> After loading the time zone tables, if .my.cnf default-time-zone is explicitly
>> set to "MDT" (what the default 'SYSTEM' value for mysql results in), I still
>> get an error.
>> I have to not only load the zone tables into the server,
>> I have to also explicitly set default-time-zone='America/Denver'
>> For some reason, 'MDT' and 'America/Denver' are not considered equivalent.

> There is what "should be" and the way it works. Opinions always vary on what should be default.
> I suspect the reason for not making a symbolic setting is the data/time information is stored numerically and all matching is done numerically.  Conversion from a symbol to a number (and any related manipulations) would slow the sql.  Do enough of them and it really messes with performance.

At first I thought this was just about server startup,
but I can see it may be about jdbc connection establishment.
If that's so, then possibly bad, depending on how often the connection is
made/broken, although it is only a hash lookup in a small table.
But there shouldn't be any translation on record access or sql computations
other that adding the GMT offset, which would be done whether the offset is
specified on the connection via symbol or number.  Output formatting is a
different matter.

localhost [(none)]> select @@GLOBAL.time_zone, @@SESSION.time_zone;
| @@GLOBAL.time_zone | @@SESSION.time_zone |
| America/Denver     | America/Denver      |
1 row in set (0.00 sec)

localhost [(none)]> select now();
| now()               |
| 2021-03-26 22:25:17 |
1 row in set (0.02 sec)


Want to link to this message? Use this URL: <>