<div id="docs-body">
 <div class="section">
  <div class="titlepage">
   <div>
    <div>
     <h4 class="title">
      <a name="timezone-problems">
      </a>
      B.3.3.7 Time Zone Problems
     </h4>
    </div>
   </div>
  </div>
  <a class="indexterm" name="idm46045053748576">
  </a>
  <a class="indexterm" name="idm46045053747504">
  </a>
  <a class="indexterm" name="idm46045053746016">
  </a>
  <a class="indexterm" name="idm46045053744944">
  </a>
  <p>
   If you have a problem with
   <code class="literal">
    SELECT NOW()
   </code>
   returning values in UTC and not your local time, you have to
          tell the server your current time zone. The same applies if
   <a class="link" href="date-and-time-functions.html#function_unix-timestamp">
    <code class="literal">
     UNIX_TIMESTAMP()
    </code>
   </a>
   returns the
          wrong value. This should be done for the environment in which
          the server runs (for example, in
   <a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
    <span class="command">
     <strong>
      mysqld_safe
     </strong>
    </span>
   </a>
   or
   <a class="link" href="mysql-server.html" title="6.3.3 mysql.server — MySQL Server Startup Script">
    <span class="command">
     <strong>
      mysql.server
     </strong>
    </span>
   </a>
   ). See
   <a class="xref" href="environment-variables.html" title="6.9 Environment Variables">
    Section 6.9, “Environment Variables”
   </a>
   .
  </p>
  <p>
   You can set the time zone for the server with the
   <a class="link" href="mysqld-safe.html#option_mysqld_safe_timezone">
    <code class="option">
     --timezone=
     <em class="replaceable">
      <code>
       timezone_name
      </code>
     </em>
    </code>
   </a>
   option to
   <a class="link" href="mysqld-safe.html" title="6.3.2 mysqld_safe — MySQL Server Startup Script">
    <span class="command">
     <strong>
      mysqld_safe
     </strong>
    </span>
   </a>
   . You can also set it
          by setting the
   <code class="literal">
    TZ
   </code>
   environment variable
          before you start
   <a class="link" href="mysqld.html" title="6.3.1 mysqld — The MySQL Server">
    <span class="command">
     <strong>
      mysqld
     </strong>
    </span>
   </a>
   .
  </p>
  <p>
   The permissible values for
   <a class="link" href="mysqld-safe.html#option_mysqld_safe_timezone">
    <code class="option">
     --timezone
    </code>
   </a>
   or
   <code class="literal">
    TZ
   </code>
   are system dependent. Consult your
          operating system documentation to see what values are
          acceptable.
  </p>
 </div>
 <br/>
</div>
