Skip to content

cPeriod::GetN()

Rainer Stötter edited this page Apr 28, 2017 · 14 revisions

Method GetN( )

 public   \libdatephp\cDate libdatephp\cPeriod::GetN(integer $n)

GetN() returns the n-th day of the managed period of time

Example:

use libdatephp;

$p1 = new cPeriod( new cDate( 11, 23, 2016 ), new cDate( 11, 25, 2016 ) ); $p2 = new cPeriod( new cDate( 11, 24, 2016 ), new cDate( 11, 27, 2016 ) );

echo $p1->GetN( 3 );

Arguments

  • $n integer - <p>the zero based index of the wanted day</p>

Returns

\libdatephp\cDate the nth day of the managed period of time

Clone this wiki locally