method

year

v2_6_3 - Show latest stable - Class: Time
year()
public

Returns the year for time (including the century).

t = Time.now   #=> 2007-11-19 08:27:51 -0600
t.year         #=> 2007