getYear() public method

Get year based on current date.
public getYear ( null | string $format = null ) : string
$format null | string A valid year format.
return string Year based on current date.
コード例 #1
0
 /**
  * @expectedException \Webiny\Component\StdLib\StdObject\StdObjectException
  * @expectedExceptionMessage Invalid format m for getYear
  */
 public function testGetYear2()
 {
     $dt = new DateTimeObject('14.02.2013');
     $this->assertSame("13", $dt->getYear('m'));
 }