Documentation for method year assembled from the following pages:

Role: Dateish §

From Dateish

(Dateish) method year §

Defined as:

method year(Date:D: --> Int:D)

Returns the year of the date.

say Date.new('2015-12-31').year;                                  # OUTPUT: «2015␤» 
say DateTime.new(date => Date.new('2015-12-24'), hour => 1).year# OUTPUT: «2015␤»