downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

Our source is open

The syntax highlighted source is automatically generated by PHP from the plaintext script. If you're interested in what's behind the several functions we used, you can always take a look at the source of the following files:

Of course, if you want to see the source of this page, we have it available. You can also browse the SVN repository for this website on svn.php.net.

Source of: /manual/en/migration51.datetime.php

<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$PARENTS = array();
include_once
dirname(__FILE__) ."/toc/migration51.inc";
$setup = array (
 
'home' =>
  array (
   
0 => 'index.php',
   
1 => 'PHP Manual',
  ),
 
'head' =>
  array (
   
0 => 'UTF-8',
   
1 => 'en',
  ),
 
'this' =>
  array (
   
0 => 'migration51.datetime.php',
   
1 => 'Date/time support',
  ),
 
'up' =>
  array (
   
0 => 'migration51.php',
   
1 => 'Migrating from PHP 5.0.x to PHP 5.1.x',
  ),
 
'prev' =>
  array (
   
0 => 'migration51.extensions.php',
   
1 => 'Extensions',
  ),
 
'next' =>
  array (
   
0 => 'migration51.databases.php',
   
1 => 'Changes in database support',
  ),
);
$setup["toc"] = $TOC;
$setup["parents"] = $PARENTS;
manual_setup($setup);

manual_header();
?>
<div id="migration51.datetime" class="section">
  <h2 class="title">Date/time support</h2>
  <p class="para">
   Date/time support has been fully rewritten in PHP 5.1.x, and no longer uses
   the system settings to &#039;know&#039; the timezone in operation. It will instead
   utilize, in the following order:
  </p>
  <ul class="itemizedlist">
   <li class="listitem">
    <p class="para">
     The timezone set using the <a href="function.date-default-timezone-set.php" class="function">date_default_timezone_set()</a>
     function (if any)
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     The TZ environment variable (if non empty)
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     &quot;magical&quot; guess (if the operating system supports it)
    </p>
   </li>
   <li class="listitem">
    <p class="para">
     If none of the above options succeeds, UTC
    </p>
   </li>
  </ul>
  <div class="informalexample">
   <p class="para">
    To ensure accuracy (and avoid an <b><tt class="constant">E_STRICT</tt></b> warning),
    you will need to define your timezone in your <var class="filename">php.ini</var>
    using the following format:
   </p>
   <p class="para">
    date.timezone = Europe/London
   </p>
  </div>
  <p class="para">
   The supported timezones are listed, in this format, in the
   <a href="timezones.php" class="link">timezones appendix</a>.
  </p>
  <p class="para">
   Also note that <a href="function.strtotime.php" class="function">strtotime()</a> now returns <b><tt class="constant">FALSE</tt></b> on
   failure, instead of -1.
  </p>
 </div><?php manual_footer(); ?>
 
show source | credits | sitemap | contact | advertising | mirror sites