IntlDateFormatter::getCalendar
datefmt_get_calendar
(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)
IntlDateFormatter::getCalendar -- datefmt_get_calendar — Lit le calendrier utilisé par l'objet IntlDateFormatter
Description
Style orienté objet
int IntlDateFormatter::getCalendar
( void
)
Style procédural
Valeurs de retour
Le calendrier utilisé par le formateur.
Exemples
Exemple #1 Exemple avec datefmt_get_calendar(), procédural
<?php
$fmt = datefmt_create( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN );
echo "Le calendrier du formateur est : ".datefmt_get_calendar($fmt);
datefmt_set_calendar($fmt,IntlDateFormatter::TRADITIONAL);
echo "Le calendrier est maintenant : ".datefmt_get_calendar($fmt);
?>
Exemple #2 Exemple avec datefmt_get_calendar(), POO
<?php
$fmt = new IntlDateFormatter( "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN );
echo "calendar of the formatter is : ".$fmt->getCalendar();
$fmt->setCalendar(IntlDateFormatter::TRADITIONAL);
echo "Le calendrier est maintenant : ".$fmt->getCalendar();
?>
L'exemple ci-dessus va afficher :
Le calendrier du formateur est : 1 Le calendrier est maintenant : 0
Voir aussi
- datefmt_set_calendar() - Définit le calendrier utilisé par le formatteur
- datefmt_create() - Crée un formateur de date
There are no user contributed notes for this page.
