<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.datetimeinterface.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'es',
  ),
  'this' => 
  array (
    0 => 'datetime.unserialize.php',
    1 => 'DateTime::__unserialize',
    2 => 'Deserializar un DateTime',
  ),
  'up' => 
  array (
    0 => 'class.datetimeinterface.php',
    1 => 'DateTimeInterface',
  ),
  'prev' => 
  array (
    0 => 'datetime.serialize.php',
    1 => 'DateTime::__serialize',
  ),
  'next' => 
  array (
    0 => 'datetime.wakeup.php',
    1 => 'DateTime::__wakeup',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'es',
    'path' => 'reference/datetime/datetimeinterface/unserialize.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetime.unserialize" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTime::__unserialize</h1>
  <h1 class="refname">DateTimeImmutable::__unserialize</h1>
  <h1 class="refname">DateTimeInterface::__unserialize</h1>
  <p class="verinfo">(PHP 8 &gt;= 8.2.0)</p><p class="refpurpose"><span class="refname">DateTime::__unserialize</span> -- <span class="refname">DateTimeImmutable::__unserialize</span> -- <span class="refname">DateTimeInterface::__unserialize</span> &mdash; <span class="dc-title">Deserializar un DateTime</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetime.unserialize-description">
  <h3 class="title">Descripción</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DateTime::__unserialize</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$data</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>DateTimeImmutable::__unserialize</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$data</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <div class="methodsynopsis dc-description"><span class="modifier">public</span> <span class="methodname"><strong>DateTimeInterface::__unserialize</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.array.php" class="type array">array</a></span> <code class="parameter">$data</code></span>): <span class="type"><a href="language.types.void.php" class="type void">void</a></span></div>

  <p class="para rdfs-comment">
   El gestor <a href="language.oop5.magic.php#object.unserialize" class="link">__unserialize()</a>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetime.unserialize-parameters">
  <h3 class="title">Parámetros</h3>
  <dl>
   
    <dt><code class="parameter">data</code></dt>
    <dd>
     <p class="para">
      El <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> serializado.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetime.unserialize-returnvalues">
  <h3 class="title">Valores devueltos</h3>
  <p class="para">
   El objeto <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span>.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-datetime.unserialize-examples">
  <h3 class="title">Ejemplos</h3>
  <div class="example" id="example-1">
   <p><strong>Ejemplo #1 Ejemplo de <span class="function"><strong>DateTime::unserialize()</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 />$serializedDate </span><span style="color: #007700">= </span><span style="color: #DD0000">'O:8:"DateTime":3:{s:4:"date";s:26:"2025-03-27 00:00:00.000000";s:13:"timezone_type";i:3;s:8:"timezone";s:3:"UTC";}'</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">unserialize</span><span style="color: #007700">(</span><span style="color: #0000BB">$serializedDate</span><span style="color: #007700">));</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">object(DateTime)#1 (3) {
  [&quot;date&quot;]=&gt;
  string(26) &quot;2025-03-27 00:00:00.000000&quot;
  [&quot;timezone_type&quot;]=&gt;
  int(3)
  [&quot;timezone&quot;]=&gt;
  string(3) &quot;UTC&quot;
}</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-datetime.unserialize-seealso">
  <h3 class="title">Ver también</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="datetime.serialize.php" class="methodname" rel="rdfs-seeAlso">DateTime::__serialize()</a> - Deserializa un DateTime</span></li>
  </ul>
 </div>

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