Skip to content

cPeriod::AddYears()

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

Method AddYears( )

 public   mixed libdatephp\cPeriod::AddYears(integer $i)

AddYears() adds $i years to the boundaries. Starting date and ending date are moved

Example:

use libdatephp;

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

echo $p1->AddYears( 3 );

Arguments

  • $i integer - <p>how much years the managed period of time should be moved, can be negative. $i defaults to 1</p>

Clone this wiki locally