IntlDateFormatter
PHP Manual

IntlDateFormatter::setCalendar

datefmt_set_calendar

(No version information available, might be only in CVS)

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

説明

オブジェクト指向型

boolean IntlDateFormatter::setCalendar ( integer $which )

手続き型

boolean datefmt_set_calendar ( IntlDateFormatter $fmt , integer $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

参考


IntlDateFormatter
PHP Manual
[お役立ちリンク集]

NPO法人の設立(東京・大阪) 東京や大阪などNPO法人を設立する場合の注意点等を紹介

不動産・賃貸・マンション 不動産・賃貸・マンションに関する用語集です。

堺市の入院・内科

大阪の賃貸探し 大阪で賃貸を探している方は大阪ホームへ

東京の賃貸マンション 東京で賃貸を探すなら東京賃貸.orgへ