IntlCalendar::toDateTime

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

IntlCalendar::toDateTimeConvert an IntlCalendar into a DateTime object

Beschreibung

Objektorientierter Stil

public IntlCalendar::toDateTime(): DateTime|false

Prozeduraler Stil

intlcal_to_date_time(IntlCalendar $calendar): DateTime|false

Create a DateTime object that represents the same instant (up to second precision, with a rounding error of less than 1 second) and has an analog timezone to this object (the difference being DateTimeʼs timezone will be backed by PHPʼs timezone while IntlCalendarʼs timezone is backed by ICUʼs).

Parameter-Liste

calendar

Eine IntlCalendar-Instanz.

Rückgabewerte

A DateTime object with the same timezone as this object (though using PHPʼs database instead of ICUʼs) and the same time, except for the smaller precision (second precision instead of millisecond). Returns false on failure.

Beispiele

Beispiel #1 IntlCalendar::toDateTime()

<?php
ini_set
('date.timezone''UTC');
ini_set('intl.default_locale''pt_PT');

$cal IntlCalendar::createInstance('Europe/Lisbon'); //current time

$dt $cal->toDateTime();
print_r($dt);

Das oben gezeigte Beispiel erzeugt folgende Ausgabe:

DateTime Object
(
    [date] => 2013-07-02 00:29:13
    [timezone_type] => 3
    [timezone] => 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

[Script] Suche umfangreiches Forum

Ich habe in den letzten Tagen nvcasino1.de - https://nvcasino1.de/ (https://nvcasino1.de/)ausprobiert. Die Registrierung war unkompliziert, und d ...

Geschrieben von michaelsmith120698 am 11.10.2025 23:19:13
Forum: Apps und PHP Script Gesuche
json Rückgabe von Open Weather darstellen

Mache mal aus var_dump($data)​ dies hier echo ""; var_dump($data); echo ""; So wird dir das Array formatiert ausgegeben und du wirst dann sic ...

Geschrieben von scatello am 11.10.2025 09:44:19
Forum: PHP Developer Forum
Helfen! Doppelte Bestelleinträge in meiner Verkaufstabelle

Oh, the bane of data! Right, duplicate entries – I feel your pain. Ever feel like your database is mocking you with mirrored realities? Why is d ...

Geschrieben von RodneyThompson am 11.10.2025 05:53:14
Forum: SQL / Datenbanken
json Rückgabe von Open Weather darstellen

Hallo Zusammen, ich habe vor über 20 Jahren das letzte mal aktiv php und HTM programmiert. Nun wollte ich für ein kleines Projekt zuhause mal w ...

Geschrieben von Chaos_Lord am 10.10.2025 21:50:09
Forum: PHP Developer Forum