<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.datetime.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'ru',
  ),
  'this' => 
  array (
    0 => 'function.getdate.php',
    1 => 'getdate',
    2 => 'Возвращает информацию о дате и времени',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Функции даты и времени',
  ),
  'prev' => 
  array (
    0 => 'function.date-timezone-set.php',
    1 => 'date_timezone_set',
  ),
  'next' => 
  array (
    0 => 'function.gettimeofday.php',
    1 => 'gettimeofday',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ru',
    'path' => 'reference/datetime/functions/getdate.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.getdate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">getdate</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">getdate</span> &mdash; <span class="dc-title">Возвращает информацию о дате и времени</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.getdate-description">
  <h3 class="title">Описание</h3>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>getdate</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$timestamp</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <span class="type"><a href="language.types.array.php" class="type array">array</a></span></div>

  <p class="para rdfs-comment">
   Функция возвращает ассоциативный массив (<span class="type"><a href="language.types.array.php" class="type array">array</a></span>)
   с информацией о дате, которую представляет либо метка времени
   <code class="parameter">timestamp</code>, либо текущее системное время,
   если аргумент <code class="parameter">timestamp</code> опустили или передали значение <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.getdate-parameters">
  <h3 class="title">Список параметров</h3>
  <p class="para">
   <dl>

    
<dt><code class="parameter">timestamp</code></dt><dd><p class="para">
 Необязательный параметр <code class="parameter">timestamp</code> —
 целочисленная (<span class="type"><a href="language.types.integer.php" class="type int">int</a></span>) метка времени, которая по умолчанию равна текущему местному времени, если параметр <code class="parameter">timestamp</code>
 не указали или равен <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>. Говоря по другому, значение по умолчанию равно результату функции <span class="function"><a href="function.time.php" class="function">time()</a></span>.
 </p></dd>

   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.getdate-returnvalues">
  <h3 class="title">Возвращаемые значения</h3>
  <p class="para">
   Функция возвращает ассоциативный массив (<span class="type"><a href="language.types.array.php" class="type array">array</a></span>) с информацией
   о моменте времени в параметре <code class="parameter">timestamp</code>. Ассоциативный массив содержит
   следующие элементы:
  </p>
  <p class="para">
   <table class="doctable table">
    <caption><strong>Индексы возвращаемого ассоциативного массива</strong></caption>
    
     <thead>
      <tr>
       <th>Индекс</th>
       <th>Описание</th>
       <th>Пример значения</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td><code class="literal">&quot;seconds&quot;</code></td>
       <td>Числовое представление секунд</td>
       <td>от <code class="literal">0</code> до <code class="literal">59</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;minutes&quot;</code></td>
       <td>Числовое представление минут</td>
       <td>от <code class="literal">0</code> до <code class="literal">59</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;hours&quot;</code></td>
       <td>Числовое представление часов</td>
       <td>от <code class="literal">0</code> до <code class="literal">23</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;mday&quot;</code></td>
       <td>Порядковый номер дня месяца</td>
       <td>от <code class="literal">1</code> до <code class="literal">31</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;wday&quot;</code></td>
       <td>Порядковый номер дня недели</td>
       <td>от <code class="literal">0</code> для воскресенья до <code class="literal">6</code> для субботы</td>
      </tr>

      <tr>
       <td><code class="literal">&quot;mon&quot;</code></td>
       <td>Порядковый номер месяца</td>
       <td>от <code class="literal">1</code> до <code class="literal">12</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;year&quot;</code></td>
       <td>Номер года, 4 цифры</td>
       <td>Примеры: <code class="literal">1999</code>, <code class="literal">2003</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;yday&quot;</code></td>
       <td>Порядковый номер дня в году</td>
       <td>от <code class="literal">0</code> до <code class="literal">365</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;weekday&quot;</code></td>
       <td>Полное название дня недели</td>
       <td>от <code class="literal">Sunday</code> до <code class="literal">Saturday</code></td>
      </tr>

      <tr>
       <td><code class="literal">&quot;month&quot;</code></td>
       <td>Полное название месяца, например, January или March</td>
       <td>от <code class="literal">January</code> до <code class="literal">December</code></td>
      </tr>

      <tr>
       <td><code class="literal">0</code></td>
       <td>
        Количество секунд, которое прошло с начала эпохи Unix,
        аналогично значению, которое возвращает функция <span class="function"><a href="function.time.php" class="function">time()</a></span>,
        и которое принимает функция <span class="function"><a href="function.date.php" class="function">date()</a></span>
       </td>
       <td>
        Значение в целочисленном диапазоне, доступном на платформе; на 32-битных системах
        значение от <code class="literal">-2147483648</code> до <code class="literal">2147483647</code>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.getdate-changelog">
  <h3 class="title">Список изменений</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Версия</th>
       <th>Описание</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        Параметр <code class="parameter">timestamp</code> теперь принимает значение <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.getdate-examples">
  <h3 class="title">Примеры</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Пример #1 Пример получения информации о дате и времени функцией <span class="function"><strong>getdate()</strong></span></strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br />$today </span><span style="color: #007700">= </span><span style="color: #0000BB">getdate</span><span style="color: #007700">();<br /></span><span style="color: #0000BB">print_r</span><span style="color: #007700">(</span><span style="color: #0000BB">$today</span><span style="color: #007700">);</span></span></code></div>
    </div>

    
<div class="example-contents"><p>
 Вывод приведённого примера будет похож на:
</p></div>

    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">Array
(
    [seconds] =&gt; 40
    [minutes] =&gt; 58
    [hours] =&gt; 21
    [mday] =&gt; 17
    [wday] =&gt; 2
    [mon] =&gt; 6
    [year] =&gt; 2003
    [yday] =&gt; 167
    [weekday] =&gt; Tuesday
    [month] =&gt; June
    [0] =&gt; 1055901520
)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.getdate-seealso">
  <h3 class="title">Смотрите также</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.date.php" class="function" rel="rdfs-seeAlso">date()</a> - Форматирует метку времени эпохи Unix</span></li>
    <li><span class="function"><a href="function.idate.php" class="function" rel="rdfs-seeAlso">idate()</a> - Форматирует компонент даты или времени местного часового пояса как целое число</span></li>
    <li><span class="function"><a href="function.localtime.php" class="function" rel="rdfs-seeAlso">localtime()</a> - Получает местное время</span></li>
    <li><span class="function"><a href="function.time.php" class="function" rel="rdfs-seeAlso">time()</a> - Возвращает метку времени Unix на основе текущего системного времени</span></li>
    <li><span class="function"><a href="function.setlocale.php" class="function" rel="rdfs-seeAlso">setlocale()</a> - Устанавливает региональные настройки</span></li>
   </ul>
  </p>
 </div>

</div><?php manual_footer($setup); ?>