instance method
Time#hour
() -> ::Integer
hour → integer
time.c
View on GitHub ↗
static VALUE
time_hour(VALUE time)
{
struct time_object *tobj;
GetTimeval(time, tobj);
MAKE_TM(time, tobj);
return INT2FIX(tobj->vtm.hour);
}
Returns the integer hour of the day for self, in range (0..23):
Example
t = Time.new(2000, 1, 2, 3, 4, 5, 6) # => 2000-01-02 03:04:05 +000006 t.hour # => 3