<?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 => 'ja',
  ),
  'this' => 
  array (
    0 => 'datetime.settime.php',
    1 => 'DateTime::setTime',
    2 => '時刻を設定する',
  ),
  'up' => 
  array (
    0 => 'class.datetime.php',
    1 => 'DateTime',
  ),
  'prev' => 
  array (
    0 => 'datetime.setisodate.php',
    1 => 'DateTime::setISODate',
  ),
  'next' => 
  array (
    0 => 'datetime.settimestamp.php',
    1 => 'DateTime::setTimestamp',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'ja',
    'path' => 'reference/datetime/datetime/settime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="datetime.settime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">DateTime::setTime</h1>
  <h1 class="refname">date_time_set</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">DateTime::setTime</span> -- <span class="refname">date_time_set</span> &mdash; <span class="dc-title">時刻を設定する</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-datetime.settime-description">
  <h3 class="title">説明</h3>
  <p class="para">オブジェクト指向型</p>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>DateTime::setTime</strong></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">$hour</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">$minute</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">$second</code><span class="initializer"> = 0</span></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">$microsecond</code><span class="initializer"> = 0</span></span><br>): <span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span></div>

  <p class="para rdfs-comment">手続き型</p>
  <div class="methodsynopsis dc-description"><span class="methodname"><a href="function.date-time-set.php" class="methodname">date_time_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">$hour</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">$minute</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">$second</code><span class="initializer"> = 0</span></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">$microsecond</code><span class="initializer"> = 0</span></span><br>): <span class="type"><a href="class.datetime.php" class="type DateTime">DateTime</a></span></div>

  <p class="para rdfs-comment">
   DateTime オブジェクトの現在時刻を別の時刻にリセットします。
  </p>
  <p class="para">
   <span class="methodname"><a href="datetimeimmutable.settime.php" class="methodname">DateTimeImmutable::setTime()</a></span> に似ていますが、
   <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> を使って動作します。
  </p>
  <p class="para">
   手続き型のバージョンは、
   <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> オブジェクトを最初の引数として取ります。
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-datetime.settime-parameters">
  <h3 class="title">パラメータ</h3>
  <dl>
   <dt><code class="parameter">object</code></dt>
<dd><p class="para">手続き型のみ:
<span class="function"><a href="function.date-create.php" class="function">date_create()</a></span> が返す <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> オブジェクト。
この関数は、このオブジェクトを変更します。</p></dd>
   
    <dt><code class="parameter">hour</code></dt>
    <dd>
     <p class="para">
      その時刻の時。
     </p>
    </dd>
   
   
    <dt><code class="parameter">minute</code></dt>
    <dd>
     <p class="para">
      その時刻の分。
     </p>
    </dd>
   
   
    <dt><code class="parameter">second</code></dt>
    <dd>
     <p class="para">
      その時刻の秒。
     </p>
    </dd>
   
   
    <dt><code class="parameter">microsecond</code></dt>
    <dd>
     <p class="para">
      その時刻のマイクロ秒。
     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-datetime.settime-returnvalues">
  <h3 class="title">戻り値</h3>
  <p class="para">
   メソッドチェインに使う、変更された <span class="classname"><a href="class.datetime.php" class="classname">DateTime</a></span> オブジェクトを返します。
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-datetime.settime-changelog">
  <h3 class="title">変更履歴</h3>
  <table class="doctable informaltable">
   
    <thead>
     <tr>
      <th>バージョン</th>
      <th>説明</th>
     </tr>

    </thead>

    <tbody class="tbody">
     <tr>
      <td>8.1.0</td>
      <td>
      (夏時間遷移のフォールバック期間中に)  二重に存在する hour
      に関する振る舞いが変更されました。
      これより前のバージョンでは、
      (夏時間遷移が起こる前の)最初の hour ではなく、
      (夏時間遷移が起きた後の)二番目の hour を取得していました。
      </td>
     </tr>

     <tr>
      <td>7.1.0</td>
      <td>パラメータ <code class="parameter">microsecond</code> が追加されました。</td>
     </tr>

    </tbody>
   
  </table>

 </div>


 <div class="refsect1 seealso" id="refsect1-datetime.settime-seealso">
  <h3 class="title">参考</h3>
  <ul class="simplelist">
   <li><span class="function"><a href="datetimeimmutable.settime.php" class="function" rel="rdfs-seeAlso">DateTimeImmutable::setTime()</a> - 時刻を設定する</span></li>
  </ul>
 </div>

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