<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.datetime.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'datetime.settime.php',
    1 => 'DateTime::setTime',
    2 => 'Assigne l\'heure',
  ),
  'up' => 
  array (
    0 => 'class.datetime.php',
    1 => 'DateTime',
  ),
  'prev' => 
  array (
    0 => 'datetime.setisodate.php',
    1 => 'DateTime::setISODate',
  ),
  'next' => 
  array (
    0 => 'datetime.settimestamp.php',
    1 => 'DateTime::setTimestamp',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/datetime/datetime/settime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetime.settime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTime::setTime</h1>
  <h1 class="refname">date_time_set</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTime::setTime</span> -- <span class="refname">date_time_set</span> &mdash; <span class="dc-title">Assigne l&#039;heure</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetime.settime-description">
  <h3 class="title">Description</h3>
  <p class="para">Style orienté objet</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DateTime::setTime</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"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$minute</code></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">$second</code><span class="initializer"> = 0</span></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">$microsecond</code><span class="initializer"> = 0</span></span><br>): <span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span></div>

  <p class="para rdfs-comment">Style procédural</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><a href="function.date-time-set.php" class="methodname">date_time_set</a></span>(<br>&nbsp;&nbsp;&nbsp;&nbsp;<span class="methodparam"><span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span> <code class="parameter">$object</code></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"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$minute</code></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">$second</code><span class="initializer"> = 0</span></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">$microsecond</code><span class="initializer"> = 0</span></span><br>): <span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span></div>

  <p class="para rdfs-comment">
   Change le temps dans l&#039;objet <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span>.
  </p>
  <p class="para">
   Comme <span class="methodname"><a href="datetimeimmutable.settime.php" class="methodname">DateTimeImmutable::setTime()</a></span> mais fonctionne avec
   <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span>.
  </p>
  <p class="para">
   La version procédurale prend un objet <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> comme
   premier argument.
  </p>
 </div>

 
 <div class="refsect1 parameters" id="refsect1-datetime.settime-parameters">
  <h3 class="title">Liste de paramètres</h3>
   <dl>
   <dt><code class="parameter">object</code></dt>
<dd><p class="para">Style procédural uniquement : Un objet <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span>
    retourné par la fonction <span class="function"><a href="function.date-create.php" class="function">date_create()</a></span>.
    Cette fonction modifie cet objet.</p></dd>
    
     <dt><code class="parameter">hour</code></dt>
     <dd>
      <p class="para">
       Heure du moment.
      </p>
     </dd>
    
    
     <dt><code class="parameter">minute</code></dt>
     <dd>
      <p class="para">
       Minute du moment.
      </p>
     </dd>
    
    
     <dt><code class="parameter">second</code></dt>
     <dd>
      <p class="para">
       Seconde du moment.
      </p>
     </dd>
    
    
    <dt><code class="parameter">microsecond</code></dt>
    <dd>
     <p class="para">
      Microsecondes du moment.
     </p>
    </dd>
   
   </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetime.settime-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne l&#039;objet modifié <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> pour chainer les méthodes.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-datetime.settime-changelog">
  <h3 class="title">Historique</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>Version</th>
      <th>Description</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.1.0</td>
      <td>
       Le comportement avec les heures doubles existantes (pendant la transition DST) a changé.
       Auparavant, PHP choisissait la deuxième occurrence (après la transition DST),
       au lieu de la première occurrence (avant la transition DST).
      </td>
     </tr>

     <tr>
      <td>7.1.0</td>
      <td>
       Le paramètre <code class="parameter">microsecond</code> a été ajouté.
      </td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-datetime.settime-seealso">
  <h3 class="title">Voir aussi</h3>
   <ul class="simplelist">
    <li><span class="function"><a href="datetimeimmutable.settime.php" class="function" rel="rdfs-seeAlso">DateTimeImmutable::setTime()</a> - D&eacute;finit l'horaire</span></li>
   </ul>
 </div>

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