<?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 => 'en',
  ),
  'this' => 
  array (
    0 => 'datetime.setdate.php',
    1 => 'DateTime::setDate',
    2 => 'Sets the date',
  ),
  'up' => 
  array (
    0 => 'class.datetime.php',
    1 => 'DateTime',
  ),
  'prev' => 
  array (
    0 => 'datetime.set-state.php',
    1 => 'DateTime::__set_state',
  ),
  'next' => 
  array (
    0 => 'datetime.setisodate.php',
    1 => 'DateTime::setISODate',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/datetime/datetime/setdate.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetime.setdate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTime::setDate</h1>
  <h1 class="refname">date_date_set</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTime::setDate</span> -- <span class="refname">date_date_set</span> &mdash; <span class="dc-title">Sets the date</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetime.setdate-description">
  <h3 class="title">Description</h3>
  <p class="para">Object-oriented style</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DateTime::setDate</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$year</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$month</code></span>, <span class="methodparam"><span class="type"><a href="language.types.integer.php" class="type int">int</a></span> <code class="parameter">$day</code></span>): <span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span></div>

  <p class="para rdfs-comment">Procedural style</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><a href="function.date-date-set.php" class="methodname">date_date_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">$year</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">$month</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">$day</code></span><br>): <span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span></div>

  <p class="para rdfs-comment">
   Resets the current date of the DateTime object to a different date.
  </p>
  <p class="para">
   Like <span class="methodname"><a href="datetimeimmutable.setdate.php" class="methodname">DateTimeImmutable::setDate()</a></span> but works with
   <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span>, and changes the existing object.
  </p>
  <p class="para">
   The procedural version takes the <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> object as
   its first argument.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetime.setdate-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   <dt><code class="parameter">object</code></dt>
<dd><p class="para">Procedural style only: A <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> object
returned by <span class="function"><a href="function.date-create.php" class="function">date_create()</a></span>.
The function modifies this object.</p></dd>
   
    <dt><code class="parameter">year</code></dt>
    <dd>
     <p class="para">
      Year of the date.
     </p>
    </dd>
   
   
    <dt><code class="parameter">month</code></dt>
    <dd>
     <p class="para">
      Month of the date.
     </p>
    </dd>
   
   
    <dt><code class="parameter">day</code></dt>
    <dd>
     <p class="para">
      Day of the date.
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetime.setdate-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns the modified <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> object for method chaining.
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-datetime.setdate-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="datetimeimmutable.setdate.php" class="function" rel="rdfs-seeAlso">DateTimeImmutable::setDate()</a> - Sets the date</span></li>
  </ul>
 </div>


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