<?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 => 'es',
  ),
  'this' => 
  array (
    0 => 'datetimeimmutable.createfromtimestamp.php',
    1 => 'DateTimeImmutable::createFromTimestamp',
    2 => 'Creates an instance from a Unix timestamp',
  ),
  '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' => 'en',
    '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">Creates an instance from a Unix timestamp</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetimeimmutable.createfromtimestamp-description">
  <h3 class="title">Descripción</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">
   Creates an instance from a Unix timestamp.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetimeimmutable.createfromtimestamp-parameters">
  <h3 class="title">Parámetros</h3>
  
  <dl>
   
    <dt><code class="parameter">timestamp</code></dt>
    <dd>
     <span class="simpara">
      Unix timestamp representing the date.
      A <span class="type"><a href="language.types.float.php" class="type float">float</a></span> value is also accepted which allows for microsecond precision.
     </span>
    </dd>
   
  </dl>
 
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetimeimmutable.createfromtimestamp-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="simpara">
   Returns a new <span class="classname"><a href="class.datetimeimmutable.php" class="classname">DateTimeImmutable</a></span> instance.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-datetimeimmutable.createfromtimestamp-errors">
  <h3 class="title">Errores/Excepciones</h3>
  <p class="simpara">
   If the <code class="parameter">timestamp</code> is outside the range [<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>],
   a <span class="exceptionname"><a href="class.daterangeerror.php" class="exceptionname">DateRangeError</a></span> is thrown.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetimeimmutable.createfromtimestamp-examples">
  <h3 class="title">Ejemplos</h3>
  <div class="example" id="datetimeimmutable.createfromtimestamp.example.basic">
   <p><strong>Ejemplo #1 <span class="methodname"><strong>DateTimeImmutable::createFromTimestamp()</strong></span> example</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>El ejemplo anterior mostrará:</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); ?>