<?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.createfromtimestamp.php',
    1 => 'DateTimeImmutable::createFromTimestamp',
    2 => 'Cr&eacute;e une instance &agrave; partir d\'un horodatage Unix',
  ),
  'up' => 
  array (
    0 => 'class.datetimeimmutable.php',
    1 => 'DateTimeImmutable',
  ),
  'prev' => 
  array (
    0 => 'datetimeimmutable.createfrommutable.php',
    1 => 'DateTimeImmutable::createFromMutable',
  ),
  'next' => 
  array (
    0 => 'datetimeimmutable.getlasterrors.php',
    1 => 'DateTimeImmutable::getLastErrors',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/datetime/datetimeimmutable/createfromtimestamp.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetimeimmutable.createfromtimestamp" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTimeImmutable::createFromTimestamp</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.4.0)</p><p class="refpurpose"><span class="refname">DateTimeImmutable::createFromTimestamp</span> &mdash; <span class="dc-title">Crée une instance à partir d&#039;un horodatage Unix</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetimeimmutable.createfromtimestamp-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">static</span> <span class="modifier">function</span> <span class="methodname"><strong>DateTimeImmutable::createFromTimestamp</strong></span>(<span class="methodparam"><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.float.php" class="type float">float</a></span></span> <code class="parameter">$timestamp</code></span>): <span class="type">static</span></div>


  <p class="simpara">
   Crée une instance à partir d&#039;un horodatage Unix.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetimeimmutable.createfromtimestamp-parameters">
  <h3 class="title">Liste de paramètres</h3>

  <dl>
   
    <dt><code class="parameter">timestamp</code></dt>
    <dd>
     <span class="simpara">
      Horodatage Unix représentant la date.
      Une valeur de type <a href="language.types.float.php" class="link">nombre décimal</a> est également acceptée, ce qui permet une précision à la microseconde.
     </span>
    </dd>
   
  </dl>

 </div>


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


 <div class="refsect1 errors" id="refsect1-datetimeimmutable.createfromtimestamp-errors">
  <h3 class="title">Erreurs / Exceptions</h3>
  <p class="simpara">
   Si <code class="parameter">timestamp</code> est en dehors de l&#039;intervalle [<strong><code><a href="reserved.constants.php#constant.php-int-min">PHP_INT_MIN</a></code></strong>, <strong><code><a href="reserved.constants.php#constant.php-int-max">PHP_INT_MAX</a></code></strong>],
   une <span class="exceptionname"><a href="class.daterangeerror.php" class="exceptionname">DateRangeError</a></span> est lancée.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetimeimmutable.createfromtimestamp-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="datetimeimmutable.createfromtimestamp.example.basic">
   <p><strong>Exemple #1 Exemple avec <span class="methodname"><strong>DateTimeImmutable::createFromTimestamp()</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 />$date </span><span style="color: #007700">= </span><span style="color: #0000BB">DateTimeImmutable</span><span style="color: #007700">::</span><span style="color: #0000BB">createFromTimestamp</span><span style="color: #007700">(</span><span style="color: #0000BB">123.456789</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">$date</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">format</span><span style="color: #007700">(</span><span style="color: #DD0000">'Y-m-d H:i:s.u'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

   <div class="example-contents"><p>L&#039;exemple ci-dessus va afficher :</p></div>
   <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">1970-01-01 00:02:03.456789</pre>
</div>
   </div>
  </div>
 </div>


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