<?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.strftime.php',
    1 => 'strftime',
    2 => 'Formatiert eine Zeit-/Datumsangabe gem&auml;&szlig; dem Gebietsschema',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Datum/Uhrzeit-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.mktime.php',
    1 => 'mktime',
  ),
  'next' => 
  array (
    0 => 'function.strptime.php',
    1 => 'strptime',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/datetime/functions/strftime.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.strftime" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">strftime</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">strftime</span> &mdash; <span class="dc-title">Formatiert eine Zeit-/Datumsangabe gemäß dem Gebietsschema</span></p>

 </div>

 <div id="function.strftime-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warnung</strong><p class="simpara">Diese Funktion wurde
in PHP 8.1.0 als <em>DEPRECATED</em> (veraltet) markiert. Es wird dringend davon abgeraten,
sich auf diese Funktion zu verlassen.</p></div>
<p class="para">
 Alternativ können die folgenden Funktionen verwendet werden:
</p>

  <ul class="simplelist">
   <li><span class="function"><a href="function.date.php" class="function">date()</a></span></li>
   <li><span class="methodname"><a href="intldateformatter.format.php" class="methodname">IntlDateFormatter::format()</a></span></li>
  </ul>
 </div>

 <div class="refsect1 description" id="refsect1-function.strftime-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description">
   <span class="attribute"><a href="class.deprecated.php">#[\Deprecated]</a> </span><br>
   <span class="methodname"><strong>strftime</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.string.php" class="type string">string</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 eine Zeit-/Datumsangabe gemäß dem Gebietsschema. Monats- und
   Wochentagsnamen sowie andere sprachabhängige Zeichenketten werden
   entsprechend des per <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span> eingestellten Wertes
   dargestellt.
  </p>
  <div class="warning"><strong class="warning">Warnung</strong>
   <p class="para">
    Es ist durchaus möglich, dass die verwendete C-Bibliothek nicht alle
    angegebenen Formatierungszeichen erkennt. In diesem Fall werden diese
    Zeichen von der PHP-Funktion <span class="function"><strong>strftime()</strong></span> nicht
    unterstützt. Außerdem unterstützen nicht alle Plattformen negative
    Zeitstempel, weshalb der Wertebereich eines Datums durch den Beginn der
    Unix-Epoche begrenzt sein könnte. Das bedeutet, dass z. B. %e, %T, %R und
    %D (und vielleicht noch weitere) und Zeitangaben vor dem
    <code class="literal">Jan 1, 1970</code> auf Windows-Systemen, einigen
    Linux-Distributionen und einigen anderen Betriebssytemen nicht
    funktionieren. Für Windows-Systeme gibt es im
    <a href="http://msdn.microsoft.com/en-us/library/fe06s4ak.aspx" class="link external">&raquo;&nbsp;<abbr title="Microsoft Developer Network">MSDN</abbr></a>
    eine komplette Übersicht der gültigen Platzhalter im Formatierungsstring.
    Stattdessen sollte die Methode
    <span class="methodname"><a href="intldateformatter.format.php" class="methodname">IntlDateFormatter::format()</a></span> verwendet werden.
   </p>
  </div>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.strftime-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>Folgende Zeichen werden in der Zeichenkette des Parameters <code class="parameter">format</code> erkannt</strong></caption>
        
         <thead>
          <tr>
           <th><code class="parameter">format</code></th>
           <th>Beschreibung</th>
           <th>Wertebeispiel</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td style="text-align: center;"><em>Tag</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%a</code></td>
           <td>Abgekürzter Name des Wochentages</td>
           <td><code class="literal">So</code> bis <code class="literal">Sa</code></td>
          </tr>

          <tr>
           <td><code class="literal">%A</code></td>
           <td>Ausgeschriebener Name des Wochentages</td>
           <td><code class="literal">Sonntag</code> bis <code class="literal">Samstag</code></td>
          </tr>

          <tr>
           <td><code class="literal">%d</code></td>
           <td>
            Tag des Monats als zweistellige Zahl (ggf. mit vorangestellter Null)
           </td>
           <td><code class="literal">01</code> bis <code class="literal">31</code></td>
          </tr>

          <tr>
           <td><code class="literal">%e</code></td>
           <td>
            Tag des Monats; einstelligen Werten wird ein Leerzeichen
            vorangestellt. Unter Windows nicht wie beschrieben implementiert;
            siehe weiter unten für weitere Informationen.
           </td>
           <td><code class="literal"> 1</code> bis <code class="literal">31</code></td>
          </tr>

          <tr>
           <td><code class="literal">%j</code></td>
           <td>
            Tag des Jahres als dreistellige Zahl, ggf. mit vorangestellten Nullen
           </td>
           <td><code class="literal">001</code> bis <code class="literal">366</code></td>
          </tr>

          <tr>
           <td><code class="literal">%u</code></td>
           <td>Numerische Darstellung des Wochentags nach ISO-8601</td>
           <td>
            <code class="literal">1</code> (für Montag) bis <code class="literal">7</code> (für Sonntag)
           </td>
          </tr>

          <tr>
           <td><code class="literal">%w</code></td>
           <td>Numerische Darstellung des Wochentags</td>
           <td>
            <code class="literal">0</code> (für Sonntag) bis <code class="literal">6</code> (für Samstag)
           </td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Woche</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%U</code></td>
           <td>
            Nummer der Kalenderwoche des gegebenen Jahres, beginnend mit dem
            ersten Sonntag als erste Woche
           </td>
           <td>
            <code class="literal">13</code> (für die 13. Kalenderwoche des Jahres)
           </td>
          </tr>

          <tr>
           <td><code class="literal">%V</code></td>
           <td>
            Nummer der Kalenderwoche des gegebenen Jahres nach ISO-8601:1988,
            beginnend mit der ersten Woche des Jahres mit wenigstens 4
            Wochentagen, wobei Montag der Start der Kalenderwoche ist
           </td>
           <td>
            <code class="literal">01</code> bis <code class="literal">53</code> (wobei 53 eine
            überlappende Woche repräsentiert)
           </td>
          </tr>

          <tr>
           <td><code class="literal">%W</code></td>
           <td>
            Numerische Darstellung der Kalenderwoche, beginnend mit dem ersten
            Montag als erste Woche
           </td>
           <td>
            <code class="literal">46</code> (für die 46. Woche des Jahres, die mit einem
            Montag beginnt)
           </td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Monat</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%b</code></td>
           <td>Abgekürzter Monatsname gemäß dem Gebietsschema</td>
           <td><code class="literal">Jan</code> bis <code class="literal">Dez</code></td>
          </tr>

          <tr>
           <td><code class="literal">%B</code></td>
           <td>Vollständiger Monatsname gemäß dem Gebietsschema</td>
           <td><code class="literal">Januar</code> bis <code class="literal">Dezember</code></td>
          </tr>

          <tr>
           <td><code class="literal">%h</code></td>
           <td>
            Abgekürzter Monatsname gemäß dem Gebietsschema (ein Alias von %b)
           </td>
           <td><code class="literal">Jan</code> bis <code class="literal">Dez</code></td>
          </tr>

          <tr>
           <td><code class="literal">%m</code></td>
           <td>Zweistellige numerische Darstellung des Monats</td>
           <td>
            <code class="literal">01</code> (für Januar) bis <code class="literal">12</code> (für
            Dezember)
           </td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Jahr</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%C</code></td>
           <td>
            Zweistellige numerische Darstellung des Jahrhunders (Jahr geteilt
            durch 100, abgerundet zu einer Ganzzahl)
           </td>
           <td><code class="literal">19</code> für das 20. Jahrhundert</td>
          </tr>

          <tr>
           <td><code class="literal">%g</code></td>
           <td>
            Zweistellige numerische Darstellung des Jahres gemäß dem
            ISO-8601:1988-Standard (siehe %V)
           </td>
           <td>
            Beispiel: <code class="literal">09</code> für die Woche des 6. Januar 2009
           </td>
          </tr>

          <tr>
           <td><code class="literal">%G</code></td>
           <td>Die vollständige vierstellige numerische Version von %g</td>
           <td>
            Beispiel: <code class="literal">2009</code> für die Woche des 3. Januar 2009
           </td>
          </tr>

          <tr>
           <td><code class="literal">%y</code></td>
           <td>Zweistellige numerische Darstellung des Jahres</td>
           <td>
            Beispiel: <code class="literal">09</code> für 2009, <code class="literal">79</code>
            für 1979
           </td>
          </tr>

          <tr>
           <td><code class="literal">%Y</code></td>
           <td>Vierstellige numerische Darstellung des Jahres</td>
           <td>Beispiel: <code class="literal">2038</code></td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Zeit</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%H</code></td>
           <td>
            Zweistellige numerische Darstellung der Stunde im 24-Stunden-Format
           </td>
           <td><code class="literal">00</code> bis <code class="literal">23</code></td>
          </tr>

          <tr>
           <td><code class="literal">%k</code></td>
           <td>
            Stunde im 24-Stunden-Format mit einem Leerzeichen vor einstelligen
            Stunden
           </td>
           <td><code class="literal"> 0</code> bis <code class="literal">23</code></td>
          </tr>

          <tr>
           <td><code class="literal">%I</code></td>
           <td>
            Zweistellige numerische Darstellung der Stunde im 12-Stunden-Format
           </td>
           <td><code class="literal">01</code> bis <code class="literal">12</code></td>
          </tr>

          <tr>
           <td><code class="literal">%l (kleines &#039;L&#039;)</code></td>
           <td>
            Stunde im 12-Stunden-Format mit einem Leerzeichen vor einstelligen
            Stunden
           </td>
           <td><code class="literal"> 1</code> bis <code class="literal">12</code></td>
          </tr>

          <tr>
           <td><code class="literal">%M</code></td>
           <td>Zweistellige numerische Darstellung der Minute</td>
           <td><code class="literal">00</code> bis <code class="literal">59</code></td>
          </tr>

          <tr>
           <td><code class="literal">%p</code></td>
           <td>
            &#039;AM&#039; oder &#039;PM&#039; in Großbuchstaben, basierend auf der gegebenen Zeit
           </td>
           <td>
            Beispiel: <code class="literal">AM</code> für 00:31, <code class="literal">PM</code>
            für 22:23. Das genaue Ergebnis hängt vom Betriebssystem ab und es
            können auch Varianten in Kleinbuchstaben oder mit Punkten (wie
            <code class="literal">a.m.</code>) zurückgegeben werden.
           </td>
          </tr>

          <tr>
           <td><code class="literal">%P</code></td>
           <td>
            &#039;am&#039; oder &#039;pm&#039; in Kleinbuchstaben, basierend auf der gegebenen Zeit
           </td>
           <td>
            Beispiel: <code class="literal">am</code> für 00:31, <code class="literal">pm</code>
            für 22:23; wird nicht von allen Betriebssystem unterstützt.
           </td>
          </tr>

          <tr>
           <td><code class="literal">%r</code></td>
           <td>Das gleiche wie &quot;%I:%M:%S %p&quot;</td>
           <td>Beispiel: <code class="literal">09:34:17 PM</code> für 21:34:17</td>
          </tr>

          <tr>
           <td><code class="literal">%R</code></td>
           <td>Das gleiche wie &quot;%H:%M&quot;</td>
           <td>
            Beispiel: <code class="literal">00:35</code> für 12:35 AM,
            <code class="literal">16:44</code> für 4:44 PM
           </td>
          </tr>

          <tr>
           <td><code class="literal">%S</code></td>
           <td>Zweistellige numerische Darstellung der Sekunde</td>
           <td><code class="literal">00</code> bis <code class="literal">59</code></td>
          </tr>

          <tr>
           <td><code class="literal">%T</code></td>
           <td>Das gleiche wie &quot;%H:%M:%S&quot;</td>
           <td>Beispiel: <code class="literal">21:34:17</code> für 09:34:17 PM</td>
          </tr>

          <tr>
           <td><code class="literal">%X</code></td>
           <td>
            Bevorzugte Zeitdarstellung gemäß dem Gebietsschema, ohne Datumsangabe
           </td>
           <td>
            Beispiel: <code class="literal">03:59:16</code> oder <code class="literal">15:59:16</code>
           </td>
          </tr>

          <tr>
           <td><code class="literal">%z</code></td>
           <td>
            Die Zeitverschiebung. Unter Windows nicht wie beschrieben
            implementiert; siehe weiter unten für weitere Informationen.
           </td>
           <td>Beispiel: <code class="literal">-0500</code> für US Eastern Time</td>
          </tr>

          <tr>
           <td><code class="literal">%Z</code></td>
           <td>
            Das Zeitzonenkürzel. Unter Windows nicht wie beschrieben
            implementiert; siehe weiter unten für weitere Informationen.
           </td>
           <td>Beispiel: <code class="literal">EST</code> für Eastern Time</td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Datums- und Zeitstempel</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%c</code></td>
           <td>Bevorzugter Datums- und Zeitstempel gemäß dem Gebietsschema</td>
           <td>
            Beispiel: <code class="literal">05.02.2009 00:45:10</code> für den 5.
            Februar 2009 um 00:45:10
           </td>
          </tr>

          <tr>
           <td><code class="literal">%D</code></td>
           <td>Das gleiche wie &quot;%m/%d/%y&quot;</td>
           <td>Beispiel: <code class="literal">02/05/09</code> für den 5. Februar 2009</td>
          </tr>

          <tr>
           <td><code class="literal">%F</code></td>
           <td>
            Das gleiche wie &quot;%Y-%m-%d&quot; (oft verwendet für Datenbankzeitstempel)
           </td>
           <td>
            Beispiel: <code class="literal">2009-02-05</code> für den 5. Februar 2009
           </td>
          </tr>

          <tr>
           <td><code class="literal">%s</code></td>
           <td>
            Zeitstempel der Unix-Epochenzeit (das gleiche wie die Funktion
            <span class="function"><a href="function.time.php" class="function">time()</a></span>)
           </td>
           <td>
            Beispiel: <code class="literal">305815200</code> für den 10. September 1979,
            08:40:00
           </td>
          </tr>

          <tr>
           <td><code class="literal">%x</code></td>
           <td>
            Bevorzugte Datumsdarstellung gemäß dem Gebietsschema, ohne Zeitangabe
           </td>
           <td>
            Beispiel: <code class="literal">02/05/09</code> für den 5. Februar 2009
           </td>
          </tr>

          <tr>
           <td style="text-align: center;"><em>Verschiedenes</em></td>
           <td>---</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%n</code></td>
           <td>Ein Zeilenvorschubzeichen (&quot;\n&quot;)</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%t</code></td>
           <td>Ein Tabulatorzeichen (&quot;\t&quot;)</td>
           <td>---</td>
          </tr>

          <tr>
           <td><code class="literal">%%</code></td>
           <td>Ein buchstäbliches Prozentzeichen (&quot;%&quot;)</td>
           <td>---</td>
          </tr>

         </tbody>
        
       </table>

      </p>
      <div class="warning"><strong class="warning">Warnung</strong>
       <p class="simpara">
        Im Gegensatz zu ISO-9899:1999 beginnt Sun Solaris mit Sonntag als 1.
        Daraus folgt, dass <code class="literal">%u</code> nicht wie in diesem Handbuch
        beschrieben funktionieren kann.
       </p>
      </div>
      <div class="warning"><strong class="warning">Warnung</strong>
       <p class="para">
        <em>Nur für Windows:</em>
       </p>
       <p class="para">
        Der Platzhalter <code class="literal">%e</code> wird in der
        Windows-Implementierung dieser Funktion nicht unterstützt. Um diesen
        Wert zu erhalten, kann stattdessen der Platzhalter
        <code class="literal">%#d</code> verwendet werden. Das Beispiel weiter unten
        zeigt, wie eine Plattformübergreifende kompatible Funktion geschrieben
        werden kann.
       </p>
       <p class="para">
        Die Platzhalter <code class="literal">%z</code> und <code class="literal">%Z</code> geben
        beide den Namen der Zeitzone anstelle der Zeitverschiebung oder des
        Kürzels zurück.
       </p>
      </div>
      <div class="warning"><strong class="warning">Warnung</strong>
       <p class="simpara">
        <em>Nur für macOS und musl:</em> Der Platzhalter
        <code class="literal">%P</code> wird in der macOS-Implementierung dieser
        Funktion nicht unterstützt.
       </p>
      </div>
     </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.strftime-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt eine Zeichenkette zurück, die gemäß <code class="parameter">format</code>
   formatiert ist, wobei der angegebene Zeitstempel
   <code class="parameter">timestamp</code> verwendet wird, oder die aktuelle
   Ortszeit, falls kein Zeitstempel angegeben wurde. Monats- und
   Wochentagsnamen sowie andere sprachabhängige Zeichenketten werden
   entsprechend des per <span class="function"><a href="function.setlocale.php" class="function">setlocale()</a></span> eingestellten Wertes
   dargestellt. Die Funktion gibt <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurück, wenn
   <code class="parameter">format</code> leer ist, nicht unterstützte
   Konvertierungsangaben enthält, oder wenn die Länge der zurückgegebenen
   Zeichenkette größer als <code class="literal">4095</code> wäre.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.strftime-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>
  <p class="para">
   Da die Ausgabe von der zugrundeliegenden C-Bibliothek abhängt, werden
   einige Konvertierungszeichen nicht unterstützt. Unter Windows führt die
   Angabe unbekannter Konvertierungszeichen zu 5
   <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>-Meldungen und die Funktion gibt <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>
   zurück. Unter anderen Betriebssystemen werden unter Umständen keine
   <strong><code><a href="errorfunc.constants.php#constant.e-warning">E_WARNING</a></code></strong>-Meldungen erzeugt und die Ausgabe enthält
   möglicherweise unveränderte Konvertierungszeichen.
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.strftime-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.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.strftime-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   Dieses Beispiel funktioniert nur, wenn auf dem System die entsprechenden
   Gebietsschemen installiert sind.
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>strftime()</strong></span>-Gebietsschema-Beispiele</strong></p>
    <div class="example-contents">
<div class="annotation-non-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"C"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%A"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"fi_FI"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">" in Finnish is %A,"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"fr_FR"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">" in French %A and"</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">setlocale</span><span style="color: #007700">(</span><span style="color: #0000BB">LC_TIME</span><span style="color: #007700">, </span><span style="color: #DD0000">"de_DE"</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">" in German %A.\n"</span><span style="color: #007700">);</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 ISO 8601:1988 Wochennummer-Beispiel</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/*     Dezember 2002 / Januar 2003<br />ISOWk  Mo  Di  Mi  Do  Fr  Sa  So<br />----- ----------------------------<br />51     16  17  18  19  20  21  22<br />52     23  24  25  26  27  28  29<br />1      30  31   1   2   3   4   5<br />2       6   7   8   9  10  11  12<br />3      13  14  15  16  17  18  19   */<br /><br />// Ausgabe: 28.12.2002 - %V,%G,%Y = 52,2002,2002<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"28.12.2002 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/28/2002"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Ausgabe: 30.12.2002 - %V,%G,%Y = 1,2003,2002<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"30.12.2002 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">, </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/30/2002"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Ausgabe: 03.01.2003 - %V,%G,%Y = 1,2003,2003<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"03.01.2003 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/3/2003"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Ausgabe: 10.01.2003 - %V,%G,%Y = 2,2003,2003<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"10.01.2003 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/10/2003"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /><br /><br /></span><span style="color: #FF8000">/*     Dezember 2004 / Januar 2005<br />ISOWk  Mo  Di  Mi  Do  Fr  Sa  So<br />----- ----------------------------<br />51     13  14  15  16  17  18  19<br />52     20  21  22  23  24  25  26<br />53     27  28  29  30  31   1   2<br />1       3   4   5   6   7   8   9<br />2      10  11  12  13  14  15  16   */<br /><br />// Ausgabe: 23.12.2004 - %V,%G,%Y = 52,2004,2004<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"23.12.2004 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/23/2004"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Ausgabe: 31.12.2004 - %V,%G,%Y = 53,2004,2004<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"31.12.2004- %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"12/31/2004"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Ausgabe: 02.01.2005 - %V,%G,%Y = 53,2004,2005<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"02.01.2005 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/2/2005"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Ausgabe: 03.01.2005 - %V,%G,%Y = 1,2005,2005<br /></span><span style="color: #007700">echo </span><span style="color: #DD0000">"03.01.2005 - %V,%G,%Y = " </span><span style="color: #007700">. </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%V,%G,%Y"</span><span style="color: #007700">,</span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">"1/3/2005"</span><span style="color: #007700">)) . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-3">
    <p><strong>Beispiel #3 Plattformübergreifendes Beispiel unter Verwendung des Platzhalters <code class="literal">%e</code></strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// 1. Januar ergibt: '%e%1%' (%%, e, %%, %e, %%)<br /></span><span style="color: #0000BB">$format </span><span style="color: #007700">= </span><span style="color: #DD0000">'%%e%%%e%%'</span><span style="color: #007700">;<br /><br /></span><span style="color: #FF8000">// Prüfe auf Windows, um den Platzhalter %e korrekt zu ersetzen<br /></span><span style="color: #007700">if (</span><span style="color: #0000BB">strtoupper</span><span style="color: #007700">(</span><span style="color: #0000BB">substr</span><span style="color: #007700">(</span><span style="color: #0000BB">PHP_OS</span><span style="color: #007700">, </span><span style="color: #0000BB">0</span><span style="color: #007700">, </span><span style="color: #0000BB">3</span><span style="color: #007700">)) == </span><span style="color: #DD0000">'WIN'</span><span style="color: #007700">) {<br />    </span><span style="color: #0000BB">$format </span><span style="color: #007700">= </span><span style="color: #0000BB">preg_replace</span><span style="color: #007700">(</span><span style="color: #DD0000">'#(?&lt;!%)((?:%%)*)%e#'</span><span style="color: #007700">, </span><span style="color: #DD0000">'\1%#d'</span><span style="color: #007700">, </span><span style="color: #0000BB">$format</span><span style="color: #007700">);<br />}<br /><br />echo </span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #0000BB">$format</span><span style="color: #007700">);</span></span></code></div>
    </div>

   </div>
  </p>
  <p class="para">
   <div class="example" id="example-4">
    <p><strong>Beispiel #4 Zeige alle bekannten und unbekannten Formate an</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /><br /></span><span style="color: #FF8000">// Beschreibe die Formate<br /></span><span style="color: #0000BB">$strftimeFormats </span><span style="color: #007700">= array(<br />    </span><span style="color: #DD0000">'A' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Ausgeschriebener Name des Wochentages'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'B' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Vollständiger Monatsname gemäß dem Gebietsschema'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'C' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung des Jahrhunders (Jahr geteilt durch 100, abgerundet zu einer Ganzzahl)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'D' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Das gleiche wie "%m/%d/%y"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'E' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'F' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Das gleiche wie "%Y-%m-%d"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'G' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Vollständige vierstellige numerische Version von %g'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'H' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung der Stunde im 24-Stunden-Format'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'I' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung der Stunde im 12-Stunden-Format'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'J' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'K' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'L' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'M' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung der Minute'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'N' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'O' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'P' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'"am" oder "pm" in Kleinbuchstaben, basierend auf der gegebenen Zeit'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'Q' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'R' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Das gleiche wie "%H:%M"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'S' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung der Sekunde'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'T' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Das gleiche wie "%H:%M:%S"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'U' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Nummer der Kalenderwoche des angegebenen Jahres, beginnend mit dem ersten Sonntag als erste Woche'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'V' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Nummer der Kalenderwoche des angegebenen Jahres gemäß ISO-8601:1988, beginnend mit der ersten Woche des Jahres mit wenigstens 4 Wochentagen, wobei Montag der Start der Kalenderwoche ist'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'W' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Numerische Darstellung der Kalenderwoche, beginnend mit dem ersten Montag als erste Woche'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'X' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Bevorzugte Zeitdarstellung gemäß dem Gebietsschema, ohne Datumsangabe'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'Y' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Vierstellige numerische Darstellung des Jahres'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'Z' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Das Zeitzonenkürzel oder die Zeitzone (abhängig vom Betriebssystem)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'a' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Abgekürzter Name des Wochentages'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'b' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Abgekürzter Monatsname gemäß dem Gebietsschema'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'c' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Bevorzugter Datums- und Zeitstempel gemäß dem Gebietsschema'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'d' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Tag des Monats als zweistellige Zahl (ggf. mit vorangestellten Nullen)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'e' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Tag des Monats als Dezimalwert; einstelligen Werten wird ein Leerzeichen vorangestellt'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'f' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'g' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung  des Jahres gemäß dem ISO-8601:1988-Standard (siehe %V)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'h' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Abgekürzter Monatsname gemäß dem Gebietsschema (ein Alias von %b)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'i' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'j' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Tag des Jahres als dreistellige Zahl, ggf. mit vorangestellten Nullen'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'k' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Stunde im 24-Stunden-Format mit einem Leerzeichen vor einstelligen Stunden'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'l' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Stunde im 12-Stunden-Format mit einem Leerzeichen vor einstelligen Stunden'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'m' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung des Monats'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'n' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Ein Zeilenvorschubzeichen ("\n")'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'o' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'p' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'"AM" oder "PM" in Großbuchstaben, basierend auf der gegebenen Zeit'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'q' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'r' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Das gleiche wie "%I:%M:%S %p"'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'s' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zeitstempel der Unix-Epochenzeit'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'t' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Ein Tabulatorzeichen ("\t")'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'u' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Numerische Darstellung des Wochentags gemäß ISO-8601'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'v' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">''</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'w' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Numerische Darstellung des Wochentags'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'x' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Bevorzugte Datumsdarstellung gemäß dem Gebietsschema, ohne Zeitangabe'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'y' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Zweistellige numerische Darstellung des Jahres'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'z' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Entweder die Zeitverschiebung gegenüber UTC oder das Zeitzonenkürzel (abhängig vom Betriebssystem)'</span><span style="color: #007700">,<br />    </span><span style="color: #DD0000">'%' </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">'Ein buchstäbliches Prozentzeichen ("%")'</span><span style="color: #007700">,<br />);<br /><br /></span><span style="color: #FF8000">// Ergebnisse<br /></span><span style="color: #0000BB">$strftimeValues </span><span style="color: #007700">= array();<br /><br /></span><span style="color: #FF8000">// Werte die Formate aus und unterdrücke dabei eventuelle Fehler<br /></span><span style="color: #007700">foreach (</span><span style="color: #0000BB">$strftimeFormats </span><span style="color: #007700">as </span><span style="color: #0000BB">$format </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$description</span><span style="color: #007700">) {<br />    if (</span><span style="color: #0000BB">false </span><span style="color: #007700">!== (</span><span style="color: #0000BB">$value </span><span style="color: #007700">= @</span><span style="color: #0000BB">strftime</span><span style="color: #007700">(</span><span style="color: #DD0000">"%</span><span style="color: #007700">{</span><span style="color: #0000BB">$format</span><span style="color: #007700">}</span><span style="color: #DD0000">"</span><span style="color: #007700">))) {<br />        </span><span style="color: #0000BB">$strftimeValues</span><span style="color: #007700">[</span><span style="color: #0000BB">$format</span><span style="color: #007700">] = </span><span style="color: #0000BB">$value</span><span style="color: #007700">;<br />    }<br />}<br /><br /></span><span style="color: #FF8000">// Ermittle den längsten Wert<br /></span><span style="color: #0000BB">$maxValueLength </span><span style="color: #007700">= </span><span style="color: #0000BB">2 </span><span style="color: #007700">+ </span><span style="color: #0000BB">max</span><span style="color: #007700">(</span><span style="color: #0000BB">array_map</span><span style="color: #007700">(</span><span style="color: #DD0000">'strlen'</span><span style="color: #007700">, </span><span style="color: #0000BB">$strftimeValues</span><span style="color: #007700">));<br /><br /></span><span style="color: #FF8000">// Melde bekannte Formate<br /></span><span style="color: #007700">foreach (</span><span style="color: #0000BB">$strftimeValues </span><span style="color: #007700">as </span><span style="color: #0000BB">$format </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$value</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"Bekanntes Format   : '</span><span style="color: #007700">{</span><span style="color: #0000BB">$format</span><span style="color: #007700">}</span><span style="color: #DD0000">' = "</span><span style="color: #007700">, </span><span style="color: #0000BB">str_pad</span><span style="color: #007700">(</span><span style="color: #DD0000">"'</span><span style="color: #007700">{</span><span style="color: #0000BB">$value</span><span style="color: #007700">}</span><span style="color: #DD0000">'"</span><span style="color: #007700">, </span><span style="color: #0000BB">$maxValueLength</span><span style="color: #007700">), </span><span style="color: #DD0000">" ( </span><span style="color: #007700">{</span><span style="color: #0000BB">$strftimeFormats</span><span style="color: #007700">[</span><span style="color: #0000BB">$format</span><span style="color: #007700">]}</span><span style="color: #DD0000"> )\n"</span><span style="color: #007700">;<br />}<br /><br /></span><span style="color: #FF8000">// Melde unbekannte Formate<br /></span><span style="color: #007700">foreach (</span><span style="color: #0000BB">array_diff_key</span><span style="color: #007700">(</span><span style="color: #0000BB">$strftimeFormats</span><span style="color: #007700">, </span><span style="color: #0000BB">$strftimeValues</span><span style="color: #007700">) as </span><span style="color: #0000BB">$format </span><span style="color: #007700">=&gt; </span><span style="color: #0000BB">$description</span><span style="color: #007700">) {<br />    echo </span><span style="color: #DD0000">"Unbekanntes Format : '</span><span style="color: #007700">{</span><span style="color: #0000BB">$format</span><span style="color: #007700">}</span><span style="color: #DD0000">'   "</span><span style="color: #007700">, </span><span style="color: #0000BB">str_pad</span><span style="color: #007700">(</span><span style="color: #DD0000">' '</span><span style="color: #007700">, </span><span style="color: #0000BB">$maxValueLength</span><span style="color: #007700">), (</span><span style="color: #0000BB">$description </span><span style="color: #007700">? </span><span style="color: #DD0000">" ( </span><span style="color: #007700">{</span><span style="color: #0000BB">$description</span><span style="color: #007700">}</span><span style="color: #DD0000"> )" </span><span style="color: #007700">: </span><span style="color: #DD0000">''</span><span style="color: #007700">), </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />}</span></span></code></div>
    </div>

    <div class="example-contents"><p>Das oben gezeigte Beispiel erzeugt
eine ähnliche Ausgabe wie:</p></div>
    <div class="example-contents screen">
<div class="annotation-interactive examplescode"><pre class="examplescode">Bekanntes Format   : &#039;A&#039; = &#039;Freitag&#039;                ( Ausgeschriebener Name des Wochentages )
Bekanntes Format   : &#039;B&#039; = &#039;Dezember&#039;               ( Vollständiger Monatsname gemäß dem Gebietsschema )
Bekanntes Format   : &#039;C&#039; = &#039;20&#039;                     ( Zweistellige numerische Darstellung des Jahrhunders (Jahr geteilt durch 100, abgerundet zu einer Ganzzahl) )
Bekanntes Format   : &#039;D&#039; = &#039;12/03/10&#039;               ( Das gleiche wie &quot;%m/%d/%y&quot; )
Bekanntes Format   : &#039;F&#039; = &#039;2010-12-03&#039;             ( Das gleiche wie &quot;%Y-%m-%d&quot; )
Bekanntes Format   : &#039;G&#039; = &#039;2010&#039;                   ( Vollständige vierstellige numerische Version von %g )
Bekanntes Format   : &#039;H&#039; = &#039;11&#039;                     ( Zweistellige numerische Darstellung der Stunde im 24-Stunden-Format )
Bekanntes Format   : &#039;I&#039; = &#039;11&#039;                     ( Zweistellige numerische Darstellung der Stunde im 12-Stunden-Format )
Bekanntes Format   : &#039;M&#039; = &#039;24&#039;                     ( Zweistellige numerische Darstellung der Minute )
Bekanntes Format   : &#039;R&#039; = &#039;11:24&#039;                  ( Das gleiche wie &quot;%H:%M&quot; )
Bekanntes Format   : &#039;S&#039; = &#039;44&#039;                     ( Zweistellige numerische Darstellung der Sekunde )
Bekanntes Format   : &#039;T&#039; = &#039;11:24:44&#039;               ( Das gleiche wie &quot;%H:%M:%S&quot; )
Bekanntes Format   : &#039;U&#039; = &#039;48&#039;                     ( Nummer der Kalenderwoche des angegebenen Jahres, beginnend mit dem ersten Sonntag als erste Woche )
Bekanntes Format   : &#039;V&#039; = &#039;48&#039;                     ( Nummer der Kalenderwoche des angegebenen Jahres gemäß ISO-8601:1988, beginnend mit der ersten Woche des Jahres mit wenigstens 4 Wochentagen, wobei Montag der Start der Kalenderwoche ist )
Bekanntes Format   : &#039;W&#039; = &#039;48&#039;                     ( Numerische Darstellung der Kalenderwoche, beginnend mit dem ersten Montag als erste Woche )
Bekanntes Format   : &#039;X&#039; = &#039;11:24:44&#039;               ( Bevorzugte Zeitdarstellung gemäß dem Gebietsschema, ohne Datumsangabe )
Bekanntes Format   : &#039;Y&#039; = &#039;2010&#039;                   ( Vierstellige numerische Darstellung des Jahres )
Bekanntes Format   : &#039;Z&#039; = &#039;Mitteleuropäische Zeit&#039; ( Das Zeitzonenkürzel oder die Zeitzone (abhängig vom Betriebssystem) )
Bekanntes Format   : &#039;a&#039; = &#039;Fr&#039;                     ( Abgekürzter Name des Wochentages )
Bekanntes Format   : &#039;b&#039; = &#039;Dez&#039;                    ( Abgekürzter Monatsname gemäß dem Gebietsschema )
Bekanntes Format   : &#039;c&#039; = &#039;03.12.2010 11:24:44&#039;    ( Bevorzugter Datums- und Zeitstempel gemäß dem Gebietsschema )
Bekanntes Format   : &#039;d&#039; = &#039;03&#039;                     ( Tag des Monats als zweistellige Zahl (ggf. mit vorangestellten Nullen) )
Bekanntes Format   : &#039;e&#039; = &#039; 3&#039;                     ( Tag des Monats als Dezimalwert; einstelligen Werten wird ein Leerzeichen voran gestellt )
Bekanntes Format   : &#039;g&#039; = &#039;10&#039;                     ( Zweistellige numerische Darstellung  des Jahres gemäß dem ISO-8601:1988-Standard (siehe %V) )
Bekanntes Format   : &#039;h&#039; = &#039;Dez&#039;                    ( Abgekürzter Monatsname gemäß dem Gebietsschema (ein Alias von %b) )
Bekanntes Format   : &#039;j&#039; = &#039;337&#039;                    ( Tag des Jahres als dreistellige Zahl, ggf. mit vorangestellten Nullen )
Bekanntes Format   : &#039;m&#039; = &#039;12&#039;                     ( Zweistellige numerische Darstellung des Monats )
Bekanntes Format   : &#039;n&#039; = &#039;
&#039;                      ( Ein Zeilenvorschubzeichen (&quot;\n&quot;) )
Bekanntes Format   : &#039;r&#039; = &#039;11:24:44&#039;               ( Das gleiche wie &quot;%I:%M:%S %p&quot; )
Bekanntes Format   : &#039;t&#039; = &#039;    &#039;                   ( Ein Tabulatorzeichen (&quot;\t&quot;) )
Bekanntes Format   : &#039;u&#039; = &#039;5&#039;                      ( Numerische Darstellung des Wochentags gemäß ISO-8601 )
Bekanntes Format   : &#039;w&#039; = &#039;5&#039;                      ( Numerische Darstellung des Wochentags )
Bekanntes Format   : &#039;x&#039; = &#039;03.12.2010&#039;             ( Bevorzugte Datumsdarstellung gemäß dem Gebietsschema, ohne Zeitangabe )
Bekanntes Format   : &#039;y&#039; = &#039;10&#039;                     ( Zweistellige numerische Darstellung des Jahres )
Bekanntes Format   : &#039;z&#039; = &#039;+0100&#039;                  ( Entweder der Zeitverschiebung gegenüber UTC oder das Zeitzonenkürzel (abhängig vom Betriebssystem) )
Bekanntes Format   : &#039;%&#039; = &#039;%&#039;                      ( Ein buchstäbliches Prozentzeichen (&quot;%&quot;) )
Unbekanntes Format : &#039;E&#039;
Unbekanntes Format : &#039;J&#039;
Unbekanntes Format : &#039;K&#039;
Unbekanntes Format : &#039;L&#039;
Unbekanntes Format : &#039;N&#039;
Unbekanntes Format : &#039;O&#039;
Unbekanntes Format : &#039;P&#039;                            ( &quot;am&quot; oder &quot;pm&quot; in Kleinbuchstaben, basierend auf der gegebenen Zeit )
Unbekanntes Format : &#039;Q&#039;
Unbekanntes Format : &#039;f&#039;
Unbekanntes Format : &#039;i&#039;
Unbekanntes Format : &#039;k&#039;                            ( Stunde im 24-Stunden-Format mit einem Leerzeichen vor einstelligen Stunden )
Unbekanntes Format : &#039;l&#039;                            ( Stunde im 12-Stunden-Format mit einem Leerzeichen vor einstelligen Stunden )
Unbekanntes Format : &#039;o&#039;
Unbekanntes Format : &#039;p&#039;                            ( &quot;AM&quot; oder &quot;PM&quot; in Großbuchstaben, basierend auf der gegebenen Zeit )
Unbekanntes Format : &#039;q&#039;
Unbekanntes Format : &#039;s&#039;                            ( Zeitstempel der Unix-Epochenzeit )
Unbekanntes Format : &#039;v&#039;</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 notes" id="refsect1-function.strftime-notes">
  <h3 class="title">Anmerkungen</h3>
  <blockquote class="note"><p><strong class="note">Hinweis</strong>: 
   <span class="simpara">
    %G und %V, die auf ISO 8601:1988-Wochennummern basieren, können
    unerwartete (obgleich richtige) Ergebnisse ergeben, wenn das Nummernsystem
    nicht genau verstanden wird. Siehe die %V Beispiele auf dieser
    Handbuchseite.
   </span>
  </p></blockquote>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.strftime-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="intldateformatter.format.php" class="methodname" rel="rdfs-seeAlso">IntlDateFormatter::format()</a> - Format the date/time value as a string</span></li>
    <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><a href="http://strftime.net/" class="link external">&raquo;&nbsp;Online strftime() Format-Erstellungstool</a></li>
    <li><span class="function"><a href="function.setlocale.php" class="function" rel="rdfs-seeAlso">setlocale()</a> - Legt regionale (locale) Einstellungen fest</span></li>
    <li><span class="function"><a href="function.mktime.php" class="function" rel="rdfs-seeAlso">mktime()</a> - Liefert den Unix-Zeitstempel f&uuml;r ein Datum</span></li>
    <li><span class="function"><a href="function.strptime.php" class="function" rel="rdfs-seeAlso">strptime()</a> - Wertet eine Zeit-/Datumsangabe aus, die mit strftime
   erzeugt wurde</span></li>
    <li><span class="function"><a href="function.gmstrftime.php" class="function" rel="rdfs-seeAlso">gmstrftime()</a> - Formatiert eine Datums-/Zeitangabe in GMT/UTC-Format entsprechend den
   Locale-Einstellungen</span></li>
    <li><a href="http://www.opengroup.org/onlinepubs/007908799/xsh/strftime.html" class="link external">&raquo;&nbsp;Open-Group-Spezifikation von <span class="function"><strong>strftime()</strong></span></a></li>
   </ul>
  </p>
 </div>


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