downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

IntlDateFormatter::setLenient> <IntlDateFormatter::parse
[edit] Last updated: Fri, 17 May 2013

view this page in

IntlDateFormatter::setCalendar

datefmt_set_calendar

(PHP 5 >= 5.3.0, PECL intl >= 1.0.0)

IntlDateFormatter::setCalendar -- datefmt_set_calendarDéfinit le calendrier utilisé par le formatteur

Description

Style orienté objet

bool IntlDateFormatter::setCalendar ( int $which )

Style procédural

bool datefmt_set_calendar ( IntlDateFormatter $fmt , int $which )

Configure le calendrier à utiliser.

Liste de paramètres

fmt

La ressource de formateur IntlDateFormatter.

which

Le calendrier à utiliser. Par défaut, c'est IntlDateFormatter::GREGORIAN.

Valeurs de retour

Cette fonction retourne TRUE en cas de succès ou FALSE si une erreur survient.

Exemples

Exemple #1 Exemple avec datefmt_set_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_set_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



add a note add a note User Contributed Notes IntlDateFormatter::setCalendar - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites