<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/ref.datetime.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'de',
  ),
  'this' => 
  array (
    0 => 'function.idate.php',
    1 => 'idate',
    2 => 'Formatiert einen Teil der lokalen Zeit/des lokalen Datums als Integer',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Datum/Uhrzeit-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.gmstrftime.php',
    1 => 'gmstrftime',
  ),
  'next' => 
  array (
    0 => 'function.localtime.php',
    1 => 'localtime',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/datetime/functions/idate.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.idate" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">idate</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">idate</span> &mdash; <span class="dc-title">Formatiert einen Teil der lokalen Zeit/des lokalen Datums als Integer</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.idate-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>idate</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.string.php" class="type string">string</a></span> <code class="parameter">$format</code></span>, <span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.integer.php" class="type int">int</a></span></span> <code class="parameter">$timestamp</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>): <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.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   Formatiert den angegebenen ganzzahligen Zeitstempel
   <code class="parameter">timestamp</code> entsprechend dem angegebenen Formatzeichen
   und gibt eine Datumszahl zurück. Wenn kein Zeitstempel angegeben wird, wird
   die aktuelle Ortszeit verwendet. Mit anderen Worten:
   <code class="parameter">timestamp</code> ist optional und wird mit dem Wert der
   Funktion <span class="function"><a href="function.time.php" class="function">time()</a></span> vorbelegt.
  </p>
  <p class="para">
   Anders als die Funktion <span class="function"><a href="function.date.php" class="function">date()</a></span> akzeptiert
   <span class="function"><strong>idate()</strong></span> nur ein Zeichen im Parameter
   <code class="parameter">format</code>.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.idate-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">format</code></dt>
     <dd>
      <p class="para">
       <table class="doctable table">
        <caption><strong>
         Die folgenden Zeichen werden in der Parameterzeichenkette
         <code class="parameter">format</code> erkannt
        </strong></caption>
        
         <thead>
          <tr>
           <th><code class="parameter">format</code>-Zeichen</th>
           <th>Beschreibung</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td><code class="literal">B</code></td>
           <td>Swatch-Internetzeit (Swatch-Beat)</td>
          </tr>

          <tr>
           <td><code class="literal">d</code></td>
           <td>Tag des Monats</td>
          </tr>

          <tr>
           <td><code class="literal">h</code></td>
           <td>Stunde (12-Stunden-Format)</td>
          </tr>

          <tr>
           <td><code class="literal">H</code></td>
           <td>Stunde (24-Stunden-Format)</td>
          </tr>

          <tr>
           <td><code class="literal">i</code></td>
           <td>Minuten</td>
          </tr>

          <tr>
           <td><code class="literal">I</code> (großes i)</td>
           <td>
            Gibt <code class="literal">1</code> zurück, wenn die Sommerzeit aktiviert ist,
            andernfalls <code class="literal">0</code>
           </td>
          </tr>

          <tr>
           <td><code class="literal">L</code> (großes l)</td>
           <td>
            Gibt bei einem Schaltjahr <code class="literal">1</code> zurück, andernfalls
            <code class="literal">0</code>
           </td>
          </tr>

          <tr>
           <td><code class="literal">m</code></td>
           <td>Nummer des Monats</td>
          </tr>

          <tr>
           <td><code class="literal">N</code></td>
           <td>
            ISO-8601-Wochentag (<code class="literal">1</code> für Montag bis
            <code class="literal">7</code> für Sonntag)
           </td>
          </tr>

          <tr>
           <td><code class="literal">o</code></td>
           <td>ISO-8601-Jahr (4 Ziffern)</td>
          </tr>

          <tr>
           <td><code class="literal">s</code></td>
           <td>Sekunden</td>
          </tr>

          <tr>
           <td><code class="literal">t</code></td>
           <td>Anzahl der Tage im aktuellen Monat</td>
          </tr>

          <tr>
           <td><code class="literal">U</code></td>
           <td>
            Anzahl der Sekunden seit der Unix-Epoche - 1. Januar 1970 00:00:00 UTC -
            dies ist gleichbedeutend mit <span class="function"><a href="function.time.php" class="function">time()</a></span>
           </td>
          </tr>

          <tr>
           <td><code class="literal">w</code></td>
           <td>Wochentag (<code class="literal">0</code> für Sonntag)</td>
          </tr>

          <tr>
           <td><code class="literal">W</code></td>
           <td>
            ISO-8601-Wochennummer des Jahres, Wochen beginnend am Montag
           </td>
          </tr>

          <tr>
           <td><code class="literal">y</code></td>
           <td>Jahr (1 oder 2 Ziffern - siehe Hinweis unten)</td>
          </tr>

          <tr>
           <td><code class="literal">Y</code></td>
           <td>Jahr (4 Ziffern)</td>
          </tr>

          <tr>
           <td><code class="literal">z</code></td>
           <td>Tag des Jahres</td>
          </tr>

          <tr>
           <td><code class="literal">Z</code></td>
           <td>Zeitverschiebung in Sekunden</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    

    
<dt><code class="parameter">timestamp</code></dt><dd><p class="para">
Der optionale Parameter <code class="parameter">timestamp</code> ist ein Unix-Zeitstempel
vom Typ <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>. Falls <code class="parameter">timestamp</code> nicht übergeben
wird oder <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong> ist, wird die aktuelle lokale Zeit als Standardwert verwendet.
Er entspricht dann also dem Ergebnis der Funktion <span class="function"><a href="function.time.php" class="function">time()</a></span>.
</p></dd>

   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.idate-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt bei Erfolg einen Wert vom Typ <span class="type"><a href="language.types.integer.php" class="type int">int</a></span> zurück.
   Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben.
  </p>
  <p class="para">
   Da <span class="function"><strong>idate()</strong></span> immer einen Wert vom Typ <span class="type"><a href="language.types.integer.php" class="type int">int</a></span>
   zurückgibt und dieser nicht mit einer &quot;0&quot; beginnen kann, gibt
   <span class="function"><strong>idate()</strong></span> möglicherweise weniger Ziffern zurück, als zu
   erwarten wäre. Siehe das Beispiel unten.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.idate-errors">
  <h3 class="title">Fehler/Exceptions</h3>

   <p class="para">
Wenn die Zeitzone ungültig ist, wird bei jedem Aufruf einer Datums/Zeit-Funktion
ein Fehler der Stufe <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong> erzeugt. Siehe auch
<span class="function"><a href="function.date-default-timezone-set.php" class="function">date_default_timezone_set()</a></span></p>

 </div>


 <div class="refsect1 changelog" id="refsect1-function.idate-changelog">
  <h3 class="title">Changelog</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>Version</th>
       <th>Beschreibung</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>8.2.0</td>
       <td>
        Die Zeichen <code class="literal">N</code> (ISO-8601-Wochentag) und
        <code class="literal">o</code> (ISO-8601-Jahr) wurden hinzugefügt.
       </td>
      </tr>

      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">timestamp</code> ist nun nullable (akzeptiert den
        <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong>-Wert).
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.idate-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>idate()</strong></span>-Beispiel</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$timestamp </span><span style="color: #007700">= </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">'1st January 2004'</span><span style="color: #007700">); </span><span style="color: #FF8000">// 1072915200<br /><br />// dies gibt die Jahreszahl in einem zweistelligen Format aus<br />// da diese jedoch mit einer "0" beginnen würde, wird<br />// nur "4" ausgegeben.<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">idate</span><span style="color: #007700">(</span><span style="color: #DD0000">'y'</span><span style="color: #007700">, </span><span style="color: #0000BB">$timestamp</span><span style="color: #007700">) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #0000BB">$timestamp </span><span style="color: #007700">= </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">'1st January 2024'</span><span style="color: #007700">); </span><span style="color: #FF8000">// 1704067200<br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">idate</span><span style="color: #007700">(</span><span style="color: #DD0000">'y'</span><span style="color: #007700">, </span><span style="color: #0000BB">$timestamp</span><span style="color: #007700">);</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt folgende Ausgabe:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">4
24</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.idate-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="datetime.format.php" class="methodname" rel="rdfs-seeAlso">DateTimeInterface::format()</a> - Liefert das Datum formatiert gem&auml;&szlig; dem angegebenen Format</span></li>
    <li><span class="function"><a href="function.date.php" class="function" rel="rdfs-seeAlso">date()</a> - Formatiert einen Unix-Zeitstempel</span></li>
    <li><span class="function"><a href="function.getdate.php" class="function" rel="rdfs-seeAlso">getdate()</a> - Liefert Datums- und Zeitinformationen</span></li>
    <li><span class="function"><a href="function.time.php" class="function" rel="rdfs-seeAlso">time()</a> - Liefert den aktuellen Unix-Zeitstempel</span></li>
   </ul>
  </p>
 </div>


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