<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.datetimeimmutable.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'datetimeimmutable.createfrommutable.php',
    1 => 'DateTimeImmutable::createFromMutable',
    2 => 'Retourne une nouvelle instance de DateTimeImmutable encapsulant l\'objet DateTime fourni',
  ),
  'up' => 
  array (
    0 => 'class.datetimeimmutable.php',
    1 => 'DateTimeImmutable',
  ),
  'prev' => 
  array (
    0 => 'datetimeimmutable.createfrominterface.php',
    1 => 'DateTimeImmutable::createFromInterface',
  ),
  'next' => 
  array (
    0 => 'datetimeimmutable.getlasterrors.php',
    1 => 'DateTimeImmutable::getLastErrors',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/datetime/datetimeimmutable/createfrommutable.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetimeimmutable.createfrommutable" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTimeImmutable::createFromMutable</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.6.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTimeImmutable::createFromMutable</span> &mdash; <span class="dc-title">Retourne une nouvelle instance de DateTimeImmutable encapsulant l&#039;objet DateTime fourni</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetimeimmutable.createfrommutable-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="methodname"><strong>DateTimeImmutable::createFromMutable</strong></span>(<span class="methodparam"><span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span> <code class="parameter">$object</code></span>): <span class="type">static</span></div>

 </div>


 <div class="refsect1 parameters" id="refsect1-datetimeimmutable.createfrommutable-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">object</code></dt>
     <dd>
      <p class="para">
       L&#039;objet <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> mutable que l&#039;on veut
       convertir en version immutable. Cet objet n&#039;est pas modifié, mais
       une nouvelle instance de <span class="classname"><a href="class.datetimeimmutable.php" class="classname">DateTimeImmutable</a></span>
       est créée, contenant les mêmes informations de date, heure et
       de fuseau horaire.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetimeimmutable.createfrommutable-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="para">
   Retourne une nouvelle instance de <span class="classname"><a href="class.datetimeimmutable.php" class="classname">DateTimeImmutable</a></span>.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-datetimeimmutable.createfrommutable-changelog">
  <h3 class="title">Historique</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Description</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.0.0</td>
       <td>
        La méthode retourne une instance de la classe appelée. Auparavant, elle créait une nouvelle
        instance de <span class="classname"><a href="class.datetimeimmutable.php" class="classname">DateTimeImmutable</a></span>.
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetimeimmutable.createfrommutable-examples">
  <h3 class="title">Exemples</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Exemple #1 Création d&#039;un objet date temps immutable</strong></p>
    <div class="example-contents">
<div class="annotation-non-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$date </span><span style="color: #007700">= new </span><span style="color: #0000BB">DateTime</span><span style="color: #007700">(</span><span style="color: #DD0000">"2014-06-20 11:45 Europe/London"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">$immutable </span><span style="color: #007700">= </span><span style="color: #0000BB">DateTimeImmutable</span><span style="color: #007700">::</span><span style="color: #0000BB">createFromMutable</span><span style="color: #007700">( </span><span style="color: #0000BB">$date </span><span style="color: #007700">);</span></span></code></div>
    </div>

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


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