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

search for in the

IntlDateFormatter::setLenient> <IntlDateFormatter::parse
[edit] Last updated: Fri, 25 May 2012

view this page in

IntlDateFormatter::setCalendar

datefmt_set_calendar

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

IntlDateFormatter::setCalendar -- datefmt_set_calendar使用するカレンダーを設定する

説明

オブジェクト指向型

bool IntlDateFormatter::setCalendar ( int $which )

手続き型

bool datefmt_set_calendar ( IntlDateFormatter $fmt , int $which )

Formatter が使用するカレンダーを設定します。

パラメータ

fmt

Formatter リソース。

which

使用する カレンダー。 デフォルトは IntlDateFormatter::GREGORIAN です。

返り値

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 datefmt_set_calendar() の例

<?php
$fmt 
datefmt_create(  "en_US" ,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN  );
echo 
"calendar of the formatter is : ".datefmt_get_calendar($fmt);
datefmt_set_calendar($fmt,IntlDateFormatter::TRADITIONAL);
echo 
"Now calendar of the formatter is : ".datefmt_get_calendar($fmt);
?>

例2 オブジェクト指向の例

<?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 
"Now calendar of the formatter is : ".$fmt->getCalendar();
?>

上の例の出力は以下となります。

calendar of the formatter is : 1
Now calendar of the formatter is : 0

参考



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

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