Skip to content

cDate::Year()

Rainer Stötter edited this page May 9, 2017 · 10 revisions

Method Year( )

 public   integer libdatephp\cDate::Year()

Year() returns the year part of the date

Example:

$dt = new \libdatephp\cDate( 1, 1, 2017 );

     for ( $i = 0; $i < 12; $i++ ) {
	$dt->GoFirstWeekOfMonthISO( );
	echo "\n The first week of the month " . $dt->Month( ) . ' in ' . $dt->Year( ) . ' starts on the ' . $dt->AsSQL( );
	echo '. The month has ' . $dt->WeeksOfMonth( ) . ' calendar weeks ';
	$dt->AddMonths( );
     }

Returns

integer the year part

See also

Clone this wiki locally