|
IntlDateFormatter::formatObjectdatefmt_format_objectオブジェクトの書式を設定する 説明オブジェクト指向型
public static stringfalse IntlDateFormatter::formatObject(IntlCalendarDateTimeInterface
$datetime, arrayintstringnull $format = null, stringnull $locale = null)手続き型 stringfalse datefmt_format_object(IntlCalendarDateTimeInterface
$datetime, arrayintstringnull $format = null, stringnull $locale = null)この関数は、IntlCalendar オブジェクトや DateTime オブジェクトをフォーマットします。その際、明示的に IntlDateFormatter オブジェクトを作る必要はありません。 一時的な IntlDateFormatter が作られ、 渡されたオブジェクトのタイムゾーンを受け取ります。PHP に組み込まれているタイムゾーンデータベースは使いません。 そのかわりに、ICU のタイムゾーンデータベースを使います。 したがって、DateTime オブジェクトで使うタイムゾーン ID は ICU のデータベースに存在するものでなければいけません。 パラメータ
戻り値
結果を文字列で返します。失敗した場合に 例
例1 IntlDateFormatter::formatObject の例 上の例の出力は以下となります。
default:
6 juin 2013 17:05:06
long $format (full):
jeudi 6 juin 2013 17:05:06 heure d’été irlandaise
array $format (none, full):
17:05:06 heure d’été irlandaise
string $format (d 'of' MMMM y):
6 of June 2013
with DateTime:
lunes, 9 de septiembre de 2013 09:09:09 Hora de verano de Europa central
|