<?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.date-sunset.php',
    1 => 'date_sunset',
    2 => 'Liefert die Uhrzeit des Sonnenuntergangs f&uuml;r den angegebenen Tag und Ort',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Datum/Uhrzeit-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.date-sunrise.php',
    1 => 'date_sunrise',
  ),
  'next' => 
  array (
    0 => 'function.date-time-set.php',
    1 => 'date_time_set',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/datetime/functions/date-sunset.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.date-sunset" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">date_sunset</h1>
  <p class="verinfo">(PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">date_sunset</span> &mdash; <span class="dc-title">Liefert die Uhrzeit des Sonnenuntergangs für den angegebenen Tag und Ort</span></p>

 </div>

 <div id="function.date-sunset-refsynopsisdiv">
  <div class="warning"><strong class="warning">Warnung</strong>
   <p class="para">
    Diese Funktion ist seit PHP 8.1.0 als <em>DEPRECATED</em>
    (veraltet) markiert. Von der Verwendung dieser Funktion wird dringend
    abgeraten. Stattdessen sollte <span class="function"><a href="function.date-sun-info.php" class="function">date_sun_info()</a></span> verwendet
    werden.
   </p>
  </div>
 </div>

 <div class="refsect1 description" id="refsect1-function.date-sunset-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>date_sunset</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">$timestamp</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">$returnFormat</code><span class="initializer"> = <strong><code><a href="datetime.constants.php#constant.sunfuncs-ret-string">SUNFUNCS_RET_STRING</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.float.php" class="type float">float</a></span></span> <code class="parameter">$latitude</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.float.php" class="type float">float</a></span></span> <code class="parameter">$longitude</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.float.php" class="type float">float</a></span></span> <code class="parameter">$zenith</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span>,<br>&nbsp;&nbsp;&nbsp;&nbsp;<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.float.php" class="type float">float</a></span></span> <code class="parameter">$utcOffset</code><span class="initializer"> = <strong><code><a href="reserved.constants.php#constant.null">null</a></code></strong></span></span><br>): <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.integer.php" class="type int">int</a></span>|<span class="type"><a href="language.types.float.php" class="type float">float</a></span>|<span class="type"><a href="language.types.singleton.php" class="type false">false</a></span></span></div>

  <p class="para rdfs-comment">
   <span class="function"><strong>date_sunset()</strong></span> gibt die Uhrzeit des Sonnenuntergangs für
   den angegebenen Tag (angegeben als <code class="parameter">timestamp</code>) und
   Ort zurück.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.date-sunset-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">
   <dl>
    
     <dt><code class="parameter">timestamp</code></dt>
     <dd>
      <p class="para">
       Der Zeitstempel des Tages, für den die Uhrzeit des Sonnenuntergangs
       ermittelt wird.
      </p>
     </dd>
    
    
     <dt><code class="parameter">returnFormat</code></dt>
     <dd>
      <p class="para">
       <table class="doctable table">
        <caption><strong><code class="parameter">returnFormat</code>-Konstanten</strong></caption>
        
         <thead>
          <tr>
           <th>Konstante</th>
           <th>Beschreibung</th>
           <th>Beispiel</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>SUNFUNCS_RET_STRING</td>
           <td>Gibt das Ergebnis als <span class="type"><a href="language.types.string.php" class="type String">String</a></span> zurück</td>
           <td>16:46</td>
          </tr>

          <tr>
           <td>SUNFUNCS_RET_DOUBLE</td>
           <td>Gibt das Ergebnis als <span class="type"><a href="language.types.float.php" class="type Float">Float</a></span> zurück</td>
           <td>16.78243132</td>
          </tr>

          <tr>
           <td>SUNFUNCS_RET_TIMESTAMP</td>
           <td>Gibt das Ergebnis als <span class="type"><a href="language.types.integer.php" class="type Int">Int</a></span> zurück (Zeitstempel)</td>
           <td>1095034606</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">latitude</code></dt>
     <dd>
      <p class="para">
       Voreingestellt ist Nord, für Süd muss ein negativer Wert übergeben
       werden. Siehe auch:
       <a href="datetime.configuration.php#ini.date.default-latitude" class="link">date.default_latitude</a>
      </p>
     </dd>
    
    
     <dt><code class="parameter">longitude</code></dt>
     <dd>
      <p class="para">
       Voreingestellt ist Ost, für West muss ein negativer Wert übergeben
       werden. Siehe auch:
       <a href="datetime.configuration.php#ini.date.default-longitude" class="link">date.default_longitude</a>
      </p>
     </dd>
    
    
     <dt><code class="parameter">zenith</code></dt>
     <dd>
      <p class="para">
       <code class="parameter">zenith</code> ist der Winkel zwischen dem Mittelpunkt
       der Sonne und einer Linie senkrecht zur Erdoberfläche. Voreingestellt
       ist <a href="datetime.configuration.php#ini.date.sunset-zenith" class="link">date.sunset_zenith</a>
       <table class="doctable table">
        <caption><strong>Gebräuchliche <code class="parameter">zenith</code>-Winkel</strong></caption>
        
         <thead>
          <tr>
           <th>Winkel</th>
           <th>Beschreibung</th>
          </tr>

         </thead>

         <tbody class="tbody">
          <tr>
           <td>90°50&#039;</td>
           <td>Sonnenuntergang: der Punkt, an dem die Sonne aus dem Blickfeld verschwindet.</td>
          </tr>

          <tr>
           <td>96°</td>
           <td>Bürgerliche Dämmerung: wird üblicherweise verwendet, um das Ende der Abenddämmerung zu kennzeichnen.</td>
          </tr>

          <tr>
           <td>102°</td>
           <td>Nautische Dämmerung: der Punkt, an dem der Horizont auf See nicht mehr sichtbar ist.</td>
          </tr>

          <tr>
           <td>108°</td>
           <td>Astronomische Dämmerung: Der Punkt, an dem die Sonne aufhört, die Quelle von Licht zu sein.</td>
          </tr>

         </tbody>
        
       </table>

      </p>
     </dd>
    
    
     <dt><code class="parameter">utcOffset</code></dt>
     <dd>
      <p class="para">
       Wird in Stunden angegeben.
       Wenn <code class="parameter">returnFormat</code>
       <strong><code><a href="datetime.constants.php#constant.sunfuncs-ret-timestamp">SUNFUNCS_RET_TIMESTAMP</a></code></strong> ist, wird
       <code class="parameter">utcOffset</code> ignoriert.
      </p>
     </dd>
    
   </dl>
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.date-sunset-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt bei Erfolg die Uhrzeit des Sonnenuntergangs im angegebenen
   <code class="parameter">returnFormat</code> zurück. Bei einem Fehler wird <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> zurückgegeben. Ein
   möglicher Grund für einen Fehler ist, dass die Sonne überhaupt nicht
   untergeht, was innerhalb der Polargebiete während eines Teils des Jahres
   der Fall ist.
  </p>
 </div>


 <div class="refsect1 errors" id="refsect1-function.date-sunset-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.date-sunset-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.1.0</td>
       <td>
        Diese Funktion ist veraltet und wurde durch
        <span class="function"><a href="function.date-sun-info.php" class="function">date_sun_info()</a></span> ersetzt.
       </td>
      </tr>

      <tr>
       <td>8.0.0</td>
       <td>
        <code class="parameter">latitude</code>, <code class="parameter">longitude</code>,
        <code class="parameter">zenith</code> und <code class="parameter">utcOffset</code>
        sind nun nullable (akzeptieren 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.date-sunset-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 <span class="function"><strong>date_sunset()</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 /><br /></span><span style="color: #FF8000">/* Berechnung der Uhrzeit des Sonnenuntergangs für Lissabon, Portugal<br />Breitengrad: 38.4 Nord<br />Längengrad: 9 West<br />Zenit ~= 90<br />Zeitverschiebung: +1 GMT<br />*/<br /><br /></span><span style="color: #007700">echo </span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">"D M d Y"</span><span style="color: #007700">). </span><span style="color: #DD0000">', sunset time : ' </span><span style="color: #007700">.</span><span style="color: #0000BB">date_sunset</span><span style="color: #007700">(</span><span style="color: #0000BB">time</span><span style="color: #007700">(), </span><span style="color: #0000BB">SUNFUNCS_RET_STRING</span><span style="color: #007700">, </span><span style="color: #0000BB">38.4</span><span style="color: #007700">, -</span><span style="color: #0000BB">9</span><span style="color: #007700">, </span><span style="color: #0000BB">90</span><span style="color: #007700">, </span><span style="color: #0000BB">1</span><span style="color: #007700">);</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">Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in script on line 10
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in script on line 10
Mon Dec 20 2004, sunset time : 18:13</pre>
</div>
    </div>
   </div>
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 Kein Sonnenuntergang</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />$solstice </span><span style="color: #007700">= </span><span style="color: #0000BB">strtotime</span><span style="color: #007700">(</span><span style="color: #DD0000">'2017-12-21'</span><span style="color: #007700">);<br /></span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">date_sunset</span><span style="color: #007700">(</span><span style="color: #0000BB">$solstice</span><span style="color: #007700">, </span><span style="color: #0000BB">SUNFUNCS_RET_STRING</span><span style="color: #007700">, </span><span style="color: #0000BB">69.245833</span><span style="color: #007700">, -</span><span style="color: #0000BB">53.537222</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">Deprecated: Constant SUNFUNCS_RET_STRING is deprecated in script on line 3
Deprecated: Function date_sunset() is deprecated since 8.1, use date_sun_info() instead in script on line 3
bool(false)</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.date-sunset-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.date-sun-info.php" class="function" rel="rdfs-seeAlso">date_sun_info()</a> - Liefert ein Array mit Informationen &uuml;ber Sonnenauf- und -untergang sowie Beginn und Ende der D&auml;mmerung</span></li>
   </ul>
  </p>
 </div>


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