migration52.datetime.html

来自「php的帮助文档,涉及到PHP的案例和基本语法,以及实际应用内容」· HTML 代码 · 共 57 行

HTML
57
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html> <head>  <title>Changes in PHP datetime   support</title>  <meta http-equiv="content-type" content="text/html; charset=UTF-8"> </head> <body><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="migration52.error-messages.html">New Error Messages</a></div> <div class="next" style="text-align: right; float: right;"><a href="migration52.parameters.html">New Parameters</a></div> <div class="up"><a href="migration52.html">Migrating from PHP 5.1.x to PHP 5.2.x</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div><hr /><div id="migration52.datetime" class="section">  <h2 class="title">Changes in PHP <a href="ref.datetime.html" class="link">datetime</a>   support</h2>  <p class="para">   Since PHP 5.1.0, there has been an extension named <i>date</i>   in the PHP core. This is the new implementation of PHP&#039;s datetime support.   Although it will attempt to guess your system&#039;s timezone setting, you   should set the timezone manually. You can do this in any of three ways:  </p>  <ul class="itemizedlist">   <li class="listitem">    <span class="simpara">     in your <var class="filename">php.ini</var> using the     <a href="datetime.configuration.html#ini.date.timezone" class="link">date.timezone</a> INI directive    </span>   </li>   <li class="listitem">    <span class="simpara">     on your system using the <var class="varname">TZ</var> environmental variable    </span>   </li>   <li class="listitem">    <span class="simpara">     from your script using the convenience function      <a href="function.date-default-timezone-get.html" class="link"><a href="function.date-default-timezone-set.html" class="function">date_default_timezone_set()</a></a>    </span>   </li>  </ul>  <p class="para">   All supported <a href="timezones.html" class="link">timezones</a> are listed   in the PHP Manual.  </p>  <p class="para">   With the advent of PHP 5.2.x, there are <a href="language.types.object.html" class="type object">object</a> representations of the   date and timezone, named <i>DateTime</i> and <i>DateTimeZone</i> respectively.   The methods map to existing procedural date functions.  </p> </div><hr /><div style="text-align: center;"> <div class="prev" style="text-align: left; float: left;"><a href="migration52.error-messages.html">New Error Messages</a></div> <div class="next" style="text-align: right; float: right;"><a href="migration52.parameters.html">New Parameters</a></div> <div class="up"><a href="migration52.html">Migrating from PHP 5.1.x to PHP 5.2.x</a></div> <div class="home"><a href="index.html">PHP Manual</a></div></div></body></html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?