year()
public
Show source
/*
* call-seq:
* time.year => fixnum
*
* Returns the year for <i>time</i> (including the century).
*
* t = Time.now
* t.year
*/
static VALUE
time_year(time)
VALUE time;
{
struct time_object *tobj;
GetTimeval(time, tobj);
if (tobj->tm_got == 0) {
time_get_tm(time, tobj->gmt);
}
return LONG2NUM((long)tobj->tm.tm_year+1900);
}