title: MariaDB system_time_zone format (abbreviation vs IANA) on Linux
body: <p>I'm trying to understand how MariaDB/MySQL <strong>system_time_zone</strong> global variable is set in case it's not provided by configuration. </p>
  
  <p>So on Linux machines we configure server time zone by linking <em>/etc/localtime</em> to the entry from IANA tz database, f.e. <em>Europe/Helsinki</em>, which has <em>EEST</em> time zone abbreviation:</p>
  
  <pre><code>$date
  Tue Aug  2 17:27:38 EEST 2016
  </code></pre>
  
  <p>After start of MariaDB with default configuration we see this:</p>
  
  <pre><code>MariaDB&gt; show global variables like '%time_zone%';
  +------------------+---------------------+
  | Variable_name    | Value               |
  +------------------+---------------------+
  | system_time_zone | EEST                |
  | time_zone        | SYSTEM              |
  </code></pre>
  
  <p>So <em>system_time_zone</em> is set abbreviation, not IANA name. 
  The problem is that after running <em>Connector/J</em> with Java 8 and <em>useLegacyDatetimeCode=false</em> most of server timezones are causing </p>
  
  <pre><code>org.mariadb.jdbc.internal.util.dao.QueryException: The server time_zone 'EEST' cannot be parsed.                                        
  </code></pre>
  
  <p>during startup, because value of <em>system_time_zone</em> is searched in IANA tz database by current implementation of <em>Connector/J</em> (we used 1.3.6):</p>
  
  <blockquote>
    <p>org.mariadb.jdbc.internal.util.Utils#getTimeZone</p>
  </blockquote>
  
  <pre><code>public static TimeZone getTimeZone(String id) throws SQLException {
      TimeZone tz = java.util.TimeZone.getTimeZone(id);
      ...
      return tz;
  }
  </code></pre>
  
  <p><em>java.util.TimeZone.getTimeZone</em> is using IANA tz database under the hood.</p>
  
  <p>Some abbreviation are present in IANA database, f.e. MST or HST, but obviously it's not reliable to match abbreviation to time zone name from IANA list.</p>