<?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-default-timezone-get.php',
    1 => 'date_default_timezone_get',
    2 => 'Ermittelt die Standardzeitzone, die von allen Datums- und Zeitfunktionen in
   einem Skript verwendet wird',
  ),
  'up' => 
  array (
    0 => 'ref.datetime.php',
    1 => 'Datum/Uhrzeit-Funktionen',
  ),
  'prev' => 
  array (
    0 => 'function.date-date-set.php',
    1 => 'date_date_set',
  ),
  'next' => 
  array (
    0 => 'function.date-default-timezone-set.php',
    1 => 'date_default_timezone_set',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'de',
    'path' => 'reference/datetime/functions/date-default-timezone-get.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="function.date-default-timezone-get" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">date_default_timezone_get</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.1.0, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">date_default_timezone_get</span> &mdash; <span class="dc-title">
   Ermittelt die Standardzeitzone, die von allen Datums- und Zeitfunktionen in
   einem Skript verwendet wird
  </span></p>

 </div>
 <div class="refsect1 description" id="refsect1-function.date-default-timezone-get-description">
  <h3 class="title">Beschreibung</h3>
  <div class="methodsynopsis dc-description"><span class="methodname"><strong>date_default_timezone_get</strong></span>(): <span class="type"><a href="language.types.string.php" class="type string">string</a></span></div>

  <p class="para rdfs-comment">
   Diese Funktion versucht, die Standardzeitzone in folgender Reihenfolge zu
   ermitteln und zurückzugeben:
   <ul class="itemizedlist">
    <li class="listitem">
     <p class="para">
      Lesen der mit der Funktion <span class="function"><a href="function.date-default-timezone-set.php" class="function">date_default_timezone_set()</a></span>
      eingestellten Zeitzone (falls vorhanden)
     </p>
    </li>
    <li class="listitem">
     <p class="para">
      Lesen der INI-Option
      <a href="datetime.configuration.php#ini.date.timezone" class="link">date.timezone</a> (falls gesetzt)
     </p>
    </li>
   </ul>
  </p>
  <p class="para">
   Wenn keiner der oben genannten Versuche zum Erfolg führt, gibt
   <span class="methodname"><strong>date_default_timezone_get()</strong></span> <code class="literal">UTC</code>
   als Standardzeitzone zurück.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.date-default-timezone-get-parameters">
  <h3 class="title">Parameter-Liste</h3>
  <p class="para">Diese Funktion besitzt keine Parameter.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.date-default-timezone-get-returnvalues">
  <h3 class="title">Rückgabewerte</h3>
  <p class="para">
   Gibt einen Wert vom Typ <span class="type"><a href="language.types.string.php" class="type string">string</a></span> zurück.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.date-default-timezone-get-examples">
  <h3 class="title">Beispiele</h3>
  <p class="para">
   <div class="example" id="example-1">
    <p><strong>Beispiel #1 Ermitteln der Standardzeitzone</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />date_default_timezone_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'Europe/London'</span><span style="color: #007700">);<br /><br />if (</span><span style="color: #0000BB">date_default_timezone_get</span><span style="color: #007700">()) {<br />    echo </span><span style="color: #DD0000">'date_default_timezone_set: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">date_default_timezone_get</span><span style="color: #007700">() . </span><span style="color: #DD0000">"\n"</span><span style="color: #007700">;<br />}<br /><br />if (</span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'date.timezone'</span><span style="color: #007700">)) {<br />    echo </span><span style="color: #DD0000">'date.timezone: ' </span><span style="color: #007700">. </span><span style="color: #0000BB">ini_get</span><span style="color: #007700">(</span><span style="color: #DD0000">'date.timezone'</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">date_default_timezone_set: Europe/London
date.timezone: Europe/London</pre>
</div>
    </div>
   </div>
  </p>
  <p class="para">
   <div class="example" id="example-2">
    <p><strong>Beispiel #2 Ermitteln der Abkürzung einer Zeitzone</strong></p>
    <div class="example-contents">
<div class="annotation-interactive phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br />date_default_timezone_set</span><span style="color: #007700">(</span><span style="color: #DD0000">'America/Los_Angeles'</span><span style="color: #007700">);<br />echo </span><span style="color: #0000BB">date_default_timezone_get</span><span style="color: #007700">() . </span><span style="color: #DD0000">' =&gt; ' </span><span style="color: #007700">. </span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">'e'</span><span style="color: #007700">) . </span><span style="color: #DD0000">' =&gt; ' </span><span style="color: #007700">. </span><span style="color: #0000BB">date</span><span style="color: #007700">(</span><span style="color: #DD0000">'T'</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">America/Los_Angeles =&gt; America/Los_Angeles =&gt; PST</pre>
</div>
    </div>
   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.date-default-timezone-get-seealso">
  <h3 class="title">Siehe auch</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="function"><a href="function.date-default-timezone-set.php" class="function" rel="rdfs-seeAlso">date_default_timezone_set()</a> - Setzt die Standardzeitzone, die von allen Datums- und Zeitfunktionen benutzt wird.</span></li>
    <li><a href="timezones.php" class="xref">Liste unterst&uuml;tzter Zeitzonen</a></li>
   </ul>
  </p>
 </div>


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