Date/Time
PHP Manual

DateInterval クラス

(PHP 5 >= 5.3.0)

導入

日付の間隔をあらわします。 格納方式は、固定値 (年、月、日、時など) あるいは相対時刻 (DateTime のコンストラクタがサポートしている書式) となります。

クラス概要

DateInterval {
/* プロパティ */
public integer $y ;
public integer $m ;
public integer $d ;
public integer $h ;
public integer $i ;
public integer $s ;
public integer $invert ;
public mixed $days ;
/* メソッド */
public __construct ( string $interval_spec )
public static DateInterval createFromDateString ( string $time )
public string format ( string $format )
}

プロパティ

y

年。

m

月。

d

日。

h

時間。

i

分。

s

秒。

invert

間隔が反転している場合は 1、そうでない場合は 0DateInterval::format() を参照ください。

days

DateTime::diff() の計算における、開始日と終了日の間の日数。 それ以外の場合は daysFALSE となります。

目次


Date/Time
PHP Manual