IntlCalendar::fromDateTime

creationdev

Documentation

Conception web ecommerce
Conception web ecommerce

2500$ CAD

Référencement web expert
Référencement web expert

750$ CAD

Conception d'application web
Conception d'application web

100$ CAD

Conception web standard
Conception web standard

2500$ CAD

Formation référencement web
Formation référencement web

100$ CAD

Conception web extra
Conception web extra

5000$ CAD

Référencement web optimisé
Référencement web optimisé

500$ CAD

Référencement web stratégique
Référencement web stratégique

1000$ CAD

Conception web microsite
Conception web microsite

1000$ CAD

Référencement web organique
Référencement web organique

300$ CAD

Méthode

Méthode

IntlCalendar::fromDateTime

IntlCalendar::fromDateTime

Page Vue 26 déc. 2018
Page Vue 14 fois

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

IntlCalendar::fromDateTime — Create an IntlCalendar from a DateTime object or string

Description

Style orienté objet

public static IntlCalendar::fromDateTime(DateTime|string $datetime, ?string $locale = null): ?IntlCalendar

Style procédural

intlcal_from_date_time(DateTime|string $datetime, ?string $locale = null): ?IntlCalendar

Creates an IntlCalendar object either from a DateTime object or from a string from which a DateTime object can be built.

The new calendar will represent not only the same instant as the given DateTime (subject to precision loss for dates very far into the past or future), but also the same timezone (subject to the caveat that different timezone databases will be used, and therefore the results may differ).

Liste de paramètres

datetime

A DateTime object or a string that can be passed to DateTime::__construct().

Valeurs de retour

The created IntlCalendar object or null in case of failure. If a string is passed, any exception that occurs inside the DateTime constructor is propagated.

Exemples

Exemple #1 intlcalendar::fromDateTime()

<?php
ini_set('date.timezone', 'Europe/Lisbon');

//same as IntlCalendar::fromDateTime(new DateTime(...))
$cal1 = IntlCalendar::fromDateTime('2013-02-28 00:01:02 Europe/Berlin');

//Note the timezone is Europe/Berlin, not the default Europe/Lisbon
echo IntlDateFormatter::formatObject($cal1, 'yyyy MMMM d HH:mm:ss VVVV', 'de_DE'), "\n";

L'exemple ci-dessus va afficher :

2013 Februar 28 00:01:02 Deutschland Zeit


Source : http://www.php.net/
Ref : methode-intlcalendar::fromdatetime.php




Contact

Contact

Veuillez saisir les infos dans le formulaire d'identification
suivant pour concevoir et référencer votre site.









Veuillez saisir votre message.

Carte d'affaires

Affichage de la carte d'affaires recto/verso.

Carte d'affaires recto
Carte d'affaires verso

Partagez

Partagez

Discussion ayant comme sujet la page IntlCalendar::fromDateTime.

©2025 creationdev -  F.A.Q. -  Soutien -  Haut de page
THÈMES: