<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h3 class="title">
      <a name="timestamp-lookups">
      </a>
      10.3.14 Indexed Lookups from TIMESTAMP Columns
     </h3>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045226923264">
  </a>
  <a class="indexterm" name="idm46045226921808">
  </a>
  <p>
   Temporal values are stored in
   <a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
    <code class="literal">
     TIMESTAMP
    </code>
   </a>
   columns as UTC values,
        and values inserted into and retrieved from
   <a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
    <code class="literal">
     TIMESTAMP
    </code>
   </a>
   columns are converted
        between the session time zone and UTC. (This is the same type of
        conversion performed by the
   <a class="link" href="date-and-time-functions.html#function_convert-tz">
    <code class="literal">
     CONVERT_TZ()
    </code>
   </a>
   function. If the
        session time zone is UTC, there is effectively no time zone
        conversion.)
  </p>
  <a class="indexterm" name="idm46045226915888">
  </a>
  <p>
   Due to conventions for local time zone changes such as Daylight
        Saving Time (DST), conversions between UTC and non-UTC time
        zones are not one-to-one in both directions. UTC values that are
        distinct may not be distinct in another time zone. The following
        example shows distinct UTC values that become identical in a
        non-UTC time zone:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa29605482"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">CREATE</span> <span class="token keyword">TABLE</span> tstable <span class="token punctuation">(</span>ts <span class="token datatype">TIMESTAMP</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> time_zone <span class="token operator">=</span> <span class="token string">'UTC'</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">-- insert UTC values</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">INSERT</span> <span class="token keyword">INTO</span> tstable <span class="token keyword">VALUES</span>
       <span class="token punctuation">(</span><span class="token string">'2018-10-28 00:30:00'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>
       <span class="token punctuation">(</span><span class="token string">'2018-10-28 01:30:00'</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ts <span class="token keyword">FROM</span> tstable<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ts                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 00:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 01:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SET</span> time_zone <span class="token operator">=</span> <span class="token string">'MET'</span><span class="token punctuation">;</span> <span class="token comment" spellcheck="true">-- retrieve non-UTC values</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ts <span class="token keyword">FROM</span> tstable<span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ts                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 02:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 02:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
  </div>
  <div class="note" style="margin-left: 0.5in; margin-right: 0.5in;">
   <div class="admon-title">
    Note
   </div>
   <p>
    To use named time zones such as
    <code class="literal">
     'MET'
    </code>
    or
    <code class="literal">
     'Europe/Amsterdam'
    </code>
    , the time zone tables
          must be properly set up. For instructions, see
    <a class="xref" href="time-zone-support.html" title="7.1.15 MySQL Server Time Zone Support">
     Section 7.1.15, “MySQL Server Time Zone Support”
    </a>
    .
   </p>
  </div>
  <p>
   You can see that the two distinct UTC values are the same when
        converted to the
   <code class="literal">
    'MET'
   </code>
   time zone. This
        phenomenon can lead to different results for a given
   <a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
    <code class="literal">
     TIMESTAMP
    </code>
   </a>
   column query, depending
        on whether the optimizer uses an index to execute the query.
  </p>
  <p>
   Suppose that a query selects values from the table shown earlier
        using a
   <code class="literal">
    WHERE
   </code>
   clause to search the
   <code class="literal">
    ts
   </code>
   column for a single specific value such as
        a user-provided timestamp literal:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa84873753"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SELECT</span> ts <span class="token keyword">FROM</span> tstable
<span class="token keyword">WHERE</span> ts <span class="token operator">=</span> <span class="token string">'<em class="replaceable">literal</em>'</span><span class="token punctuation">;</span></code></pre>
  </div>
  <p>
   Suppose further that the query executes under these conditions:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      The session time zone is not UTC and has a DST shift. For
            example:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting one-line language-sql"><div class="docs-select-all right" id="sa86783854"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token keyword">SET</span> time_zone <span class="token operator">=</span> <span class="token string">'MET'</span><span class="token punctuation">;</span></code></pre>
     </div>
    </li>
    <li class="listitem">
     <p>
      Unique UTC values stored in the
      <a class="link" href="datetime.html" title="13.2.2 The DATE, DATETIME, and TIMESTAMP Types">
       <code class="literal">
        TIMESTAMP
       </code>
      </a>
      column are not
            unique in the session time zone due to DST shifts. (The
            example shown earlier illustrates how this can occur.)
     </p>
    </li>
    <li class="listitem">
     <p>
      The query specifies a search value that is within the hour
            of entry into DST in the session time zone.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Under those conditions, the comparison in the
   <code class="literal">
    WHERE
   </code>
   clause occurs in different ways for
        nonindexed and indexed lookups and leads to different results:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      If there is no index or the optimizer cannot use it,
            comparisons occur in the session time zone. The optimizer
            performs a table scan in which it retrieves each
      <code class="literal">
       ts
      </code>
      column value, converts it from UTC to
            the session time zone, and compares it to the search value
            (also interpreted in the session time zone):
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa25368158"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ts <span class="token keyword">FROM</span> tstable
       <span class="token keyword">WHERE</span> ts <span class="token operator">=</span> <span class="token string">'2018-10-28 02:30:00'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ts                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 02:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 02:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
     </div>
     <p>
      Because the stored
      <code class="literal">
       ts
      </code>
      values are
            converted to the session time zone, it is possible for the
            query to return two timestamp values that are distinct as
            UTC values but equal in the session time zone: One value
            that occurs before the DST shift when clocks are changed,
            and one value that was occurs after the DST shift.
     </p>
    </li>
    <li class="listitem">
     <p>
      If there is a usable index, comparisons occur in UTC. The
            optimizer performs an index scan, first converting the
            search value from the session time zone to UTC, then
            comparing the result to the UTC index entries:
     </p>
     <div class="copytoclipboard-wrapper">
      <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa76770608"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">ALTER</span> <span class="token keyword">TABLE</span> tstable <span class="token keyword">ADD</span> <span class="token keyword">INDEX</span> <span class="token punctuation">(</span>ts<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ts <span class="token keyword">FROM</span> tstable
       <span class="token keyword">WHERE</span> ts <span class="token operator">=</span> <span class="token string">'2018-10-28 02:30:00'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ts                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 02:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
     </div>
     <p>
      In this case, the (converted) search value is matched only
            to index entries, and because the index entries for the
            distinct stored UTC values are also distinct, the search
            value can match only one of them.
     </p>
    </li>
   </ul>
  </div>
  <p>
   Due to different optimizer operation for nonindexed and indexed
        lookups, the query produces different results in each case. The
        result from the nonindexed lookup returns all values that match
        in the session time zone. The indexed lookup cannot do so:
  </p>
  <div class="itemizedlist">
   <ul class="itemizedlist" style="list-style-type: disc; ">
    <li class="listitem">
     <p>
      It is performed within the storage engine, which knows only
            about UTC values.
     </p>
    </li>
    <li class="listitem">
     <p>
      For the two distinct session time zone values that map to
            the same UTC value, the indexed lookup matches only the
            corresponding UTC index entry and returns only a single row.
     </p>
    </li>
   </ul>
  </div>
  <p>
   In the preceding discussion, the data set stored in
   <code class="literal">
    tstable
   </code>
   happens to consist of distinct UTC
        values. In such cases, all index-using queries of the form shown
        match at most one index entry.
  </p>
  <p>
   If the index is not
   <code class="literal">
    UNIQUE
   </code>
   , it is possible
        for the table (and the index) to store multiple instances of a
        given UTC value. For example, the
   <code class="literal">
    ts
   </code>
   column
        might contain multiple instances of the UTC value
   <code class="literal">
    '2018-10-28 00:30:00'
   </code>
   . In this case, the
        index-using query would return each of them (converted to the
        MET value
   <code class="literal">
    '2018-10-28 02:30:00'
   </code>
   in the result
        set). It remains true that index-using queries match the
        converted search value to a single value in the UTC index
        entries, rather than matching multiple UTC values that convert
        to the search value in the session time zone.
  </p>
  <p>
   If it is important to return all
   <code class="literal">
    ts
   </code>
   values
        that match in the session time zone, the workaround is to
        suppress use of the index with an
   <code class="literal">
    IGNORE
        INDEX
   </code>
   hint:
  </p>
  <div class="copytoclipboard-wrapper">
   <pre class="programlisting language-sql"><div class="docs-select-all right" id="sa21713766"><div class="copy-help left">Press ⌘+C to copy</div> <div class="right"><button class="clipboard-btn" title="Copy to Clipboard"><span class="icon-clipboard"></span></button></div></div><code class="language-sql"><span class="token prompt">mysql&gt;</span> <span class="token keyword">SELECT</span> ts <span class="token keyword">FROM</span> tstable
       <span class="token keyword">IGNORE</span> <span class="token keyword">INDEX</span> <span class="token punctuation">(</span>ts<span class="token punctuation">)</span>
       <span class="token keyword">WHERE</span> ts <span class="token operator">=</span> <span class="token string">'2018-10-28 02:30:00'</span><span class="token punctuation">;</span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> ts                  <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 02:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">|</span> 2018<span class="token punctuation">-</span>10<span class="token punctuation">-</span>28 02:30:00 <span class="token punctuation">|</span></span>
<span class="token output"><span class="token punctuation">+</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">-</span><span class="token punctuation">+</span></span></code></pre>
  </div>
  <p>
   The same lack of one-to-one mapping for time zone conversions in
        both directions occurs in other contexts as well, such as
        conversions performed with the
   <a class="link" href="date-and-time-functions.html#function_from-unixtime">
    <code class="literal">
     FROM_UNIXTIME()
    </code>
   </a>
   and
   <a class="link" href="date-and-time-functions.html#function_unix-timestamp">
    <code class="literal">
     UNIX_TIMESTAMP()
    </code>
   </a>
   functions. See
   <a class="xref" href="date-and-time-functions.html" title="14.7 Date and Time Functions">
    Section 14.7, “Date and Time Functions”
   </a>
   .
  </p>
 </div>
 <br/>
</div>
