IntlDateFormatter::getTimeZone

datefmt_get_timezone

(PHP 5 >= 5.5.0, PHP 7, PHP 8, PECL intl >= 3.0.0)

IntlDateFormatter::getTimeZone -- datefmt_get_timezoneGet formatterʼs timezone

Beschreibung

Objektorientierter Stil

public IntlDateFormatter::getTimeZone(): IntlTimeZone|false

Prozeduraler Stil

datefmt_get_timezone(IntlDateFormatter $formatter): IntlTimeZone|false

Returns an IntlTimeZone object representing the timezone that will be used by this object to format dates and times. When formatting IntlCalendar and DateTime objects with this IntlDateFormatter, the timezone used will be the one returned by this method, not the one associated with the objects being formatted.

Parameter-Liste

Diese Funktion besitzt keine Parameter.

Rückgabewerte

The associated IntlTimeZone objectBei einem Fehler wird false zurückgegeben..

Beispiele

Beispiel #1 IntlDateFormatter::getTimeZone() examples

<?php

$madrid 
IntlDateFormatter::create(NULLNULLNULL'Europe/Madrid');
$lisbon IntlDateFormatter::create(NULLNULLNULL'Europe/Lisbon');

var_dump($madrid->getTimezone());
echo 
$madrid->getTimezone()->getDisplayName(
        
falseIntlTimeZone::DISPLAY_GENERIC_LOCATION"en_US"), "\n";
echo 
$lisbon->getTimeZone()->getId(), "\n";
//The id can also be retrieved with ->getTimezoneId()
echo $lisbon->getTimeZoneId(), "\n";

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

object(IntlTimeZone)#4 (4) {
  ["valid"]=>
  bool(true)
  ["id"]=>
  string(13) "Europe/Madrid"
  ["rawOffset"]=>
  int(3600000)
  ["currentOffset"]=>
  int(7200000)
}
Spain Time
Europe/Lisbon
Europe/Lisbon

Siehe auch

Hier Kannst Du einen Kommentar verfassen


Bitte gib mindestens 10 Zeichen ein.
Wird geladen... Bitte warte.
* Pflichtangabe
Es sind noch keine Kommentare vorhanden.

Was genau bedeutet "Vibe Coding"? Ein tiefgehender Blick für Entwickler

In der Welt der Softwareentwicklung gibt es unzählige Wege, wie man an ein Projekt herangeht. Manche schwören auf strikte Planung, andere auf bewährte Algorithmen und wieder andere lassen sich von etwas ganz anderem leiten: ihrem Gefühl. ...

admin

Autor : admin
Kategorie: Software & Web-Development

PHP cURL-Tutorial: Verwendung von cURL zum Durchführen von HTTP-Anfragen

cURL ist eine leistungsstarke PHP-Erweiterung, die es Ihnen ermöglicht, mit verschiedenen Servern über verschiedene Protokolle wie HTTP, HTTPS, FTP und mehr zu kommunizieren. ...

TheMax

Autor : TheMax
Kategorie: PHP-Tutorials

Midjourney Tutorial - Anleitung für Anfänger

Über Midjourney, dem Tool zur Erstellung digitaler Bilder mithilfe von künstlicher Intelligenz, gibt es ein informatives Video mit dem Titel "Midjourney Tutorial auf Deutsch - Anleitung für Anfänger" ...

Mike94

Autor : Mike94
Kategorie: KI Tutorials

Tutorial veröffentlichen

Tutorial veröffentlichen

Teile Dein Wissen mit anderen Entwicklern weltweit

Du bist Profi in deinem Bereich und möchtest dein Wissen teilen, dann melde dich jetzt an und teile es mit unserer PHP-Community

mehr erfahren

Tutorial veröffentlichen

在线购买护照(微信:GorgeAvelson22),出售合法美国护照,购买加拿大

https://globaldocs.store/documents/korean-passport-holder-visa-to-china-from-usa/在线购买护照(微信:GorgeAvelson22),出售合法美 ...

Geschrieben von thegjgf am 01.07.2026 04:09:20
Forum: PHP Developer Forum
在线购买护照(微信:GorgeAvelson22),出售合法美国护照,购买加拿大

https://globaldocs.store/documents/korean-passport-holder-visa-to-china-from-usa/在线购买护照(微信:GorgeAvelson22),出售合法美 ...

Geschrieben von thegjgf am 01.07.2026 04:07:06
Forum: Ankündigungen
Powerful abortion spel +27781594918 // miscarriage spell in america

It can be a woman facing herself on your man with A pregancy trap And you men who accidentally made a woman pregnant and you are not ready to have ...

Geschrieben von mamalaika am 01.07.2026 03:04:54
Forum: PHP Developer Forum
+27781594918 feel free to order miscarriage spell from spells caster in germany

Has your husband or lover made another woman pregnant or its your underaged daughter been impregnanted, its time to put that misery away in a very ...

Geschrieben von mamalaika am 01.07.2026 03:03:26
Forum: PHP Developer Forum