<?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 => 'uk',
  ),
  'this' => 
  array (
    0 => 'function.gmmktime.php',
    1 => 'gmmktime',
    2 => 'Get Unix timestamp for a GMT date',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Функції Дати/часу',
  ),
  'prev' => 
  array (
    0 => 'function.gmdate.php',
    1 => 'gmdate',
  ),
  'next' => 
  array (
    0 => 'function.gmstrftime.php',
    1 => 'gmstrftime',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/datetime/functions/gmmktime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.gmmktime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">gmmktime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">gmmktime</span> &mdash; <span class="dc-title">Get Unix timestamp for a GMT date</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.gmmktime-description">
  <h3 class="title">Опис</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>gmmktime</strong></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$hour</code></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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">$minute</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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">$second</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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">$month</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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">$day</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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">$year</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <span class="type"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Identical to <span class="function"><a href="function.mktime.php" class="function">mktime()</a></span> except the passed parameters represents a 
   GMT date. <span class="function"><strong>gmmktime()</strong></span> internally uses <span class="function"><a href="function.mktime.php" class="function">mktime()</a></span>
   so only times valid in derived local time can be used.
  </p>
  <p class="para">
   Like <span class="function"><a href="function.mktime.php" class="function">mktime()</a></span>, optional arguments may be left out in
   order from right to left, with any omitted arguments being set to the
   current corresponding GMT value.
  </p>
  <p class="simpara">
   Calling <span class="function"><strong>gmmktime()</strong></span> without any arguments is not
   supported, and will result in an <span class="classname"><a href="class.argumentcounterror.php" class="classname">ArgumentCountError</a></span>.
   <span class="function"><a href="function.time.php" class="function">time()</a></span> can be used to get the current timestamp.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.gmmktime-parameters">
  <h3 class="title">Параметри</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">hour</code></dt>
     <dd>
      <p class="para">
       The number of the hour relative to the start of the day determined by
       <code class="parameter">month</code>, <code class="parameter">day</code> and <code class="parameter">year</code>.
       Negative values reference the hour before midnight of the day in question.
       Values greater than 23 reference the appropriate hour in the following day(s).
      </p>
     </dd>
    
    
     <dt><code class="parameter">minute</code></dt>
     <dd>
      <p class="para">
       The number of the minute relative to the start of the <code class="parameter">hour</code>.
       Negative values reference the minute in the previous hour.
       Values greater than 59 reference the appropriate minute in the following hour(s).
      </p>
     </dd>
    
    
     <dt><code class="parameter">second</code></dt>
     <dd>
      <p class="para">
       The number of seconds relative to the start of the <code class="parameter">minute</code>.
       Negative values reference the second in the previous minute.
       Values greater than 59 reference the appropriate second in the following minute(s).
      </p>
     </dd>
    
    
     <dt><code class="parameter">month</code></dt>
     <dd>
      <p class="para">
       The number of the month relative to the end of the previous year.
       Values 1 to 12 reference the normal calendar months of the year in question.
       Values less than 1 (including negative values) reference the months in the previous year in reverse order, so 0 is December, -1 is November, etc.
       Values greater than 12 reference the appropriate month in the following year(s).
      </p>
     </dd>
    
    
     <dt><code class="parameter">day</code></dt>
     <dd>
      <p class="para">
       The number of the day relative to the end of the previous month.
       Values 1 to 28, 29, 30 or 31 (depending upon the month) reference the normal days in the relevant month.
       Values less than 1 (including negative values) reference the days in the previous month, so 0 is the last day of the previous month, -1 is the day before that, etc.
       Values greater than the number of days in the relevant month reference the appropriate day in the following month(s).
      </p>
     </dd>
    
    
     <dt><code class="parameter">year</code></dt>
     <dd>
      <p class="para">
       The year
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.gmmktime-returnvalues">
  <h3 class="title">Значення, що повертаються</h3>
  <p class="para">
   Returns a <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> Unix timestamp on success, or <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> if the
   timestamp doesn&#039;t fit in a PHP integer.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.gmmktime-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">hour</code> is no longer optional. If you need a Unix
        timestamp, use <span class="function"><a href="function.time.php" class="function">time()</a></span>.
       </td>
      </tr>

      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">minute</code>, <code class="parameter">second</code>, <code class="parameter">month</code>,
        <code class="parameter">day</code> and <code class="parameter">year</code> are nullable now.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.gmmktime-examples">
  <h3 class="title">Приклади</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Приклад #1 <span class="function"><strong>gmmktime()</strong></span> basic example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />date_default_timezone_set</span><span style="color: #007700">(</span><span style="color: #DD0000">"Indian/Maldives"</span><span style="color: #007700">);<br /><br />echo </span><span style="color: #DD0000">"July 1, 2000 is on a " </span><span style="color: #007700">. </span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"l"</span><span style="color: #007700">, </span><span style="color: #0000BB">gmmktime</span><span style="color: #007700">(</span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">7</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">, </span><span style="color: #0000BB">2000</span><span style="color: #007700">));</span></span></code></div>
    </div>

    <div class="example-contents"><p>Поданий вище приклад
виведе:</p></div>
    <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">July 1, 2000 is on a Saturday</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.gmmktime-seealso">
  <h3 class="title">Прогляньте також</h3>
  <p class="para">
   <ul class="simplelist">
    <li>The <span class="classname"><a href="class.datetimeimmutable.php" class="classname">DateTimeImmutable</a></span> class</li>
    <li><span class="function"><a href="function.mktime.php" class="function" rel="rdfs-seeAlso">mktime()</a> - Get Unix timestamp for a date</span></li>
    <li><span class="function"><a href="function.date.php" class="function" rel="rdfs-seeAlso">date()</a> - Format a Unix timestamp</span></li>
    <li><span class="function"><a href="function.time.php" class="function" rel="rdfs-seeAlso">time()</a> - Return current Unix timestamp</span></li>
   </ul>
  </p>
 </div>

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