|
IntlCalendar::isLenient日付と時刻の解釈を「緩いモード」で行うかを取得する 説明オブジェクト指向型
public bool IntlCalendar::isLenient()
手続き型 bool intlcal_is_lenient(IntlCalendar
$calendar)現在の日付/時刻の解釈が「緩いモード」(デフォルト) で行われているかを返します。 緩いモードの場合、フィールドの範囲外の値によっては、 エラーを発生させることなく受け入れられる場合があります。 パラメータ
戻り値カレンダーが「緩いモード」に設定されているかどうかを bool で返します。 例
例1 IntlCalendar::isLenient 上の例の出力は以下となります。
string(20) "01/07/2013, 00:00:00"
bool(true)
string(20) "02/08/2013, 00:00:00"
bool(false)
Fatal error: Uncaught exception 'IntlException' with message 'datefmt_format_object: error obtaining instant from IntlCalendar' in /home/foobar/example.php:16
Stack trace:
#0 /home/foobar/example.php(16): IntlDateFormatter::formatObject(Object(IntlGregorianCalendar))
#1 {main}
thrown in /home/foobar/example.php on line 16
|