Preview Ruby 4.1 is a preview. It can change before the final release. Switch to Ruby 4.0 →
instance method
Time#day
() -> ::Integer
day
time.c
View on GitHub ↗
static VALUE
time_mday(VALUE time)
{
struct time_object *tobj;
GetTimeval(time, tobj);
MAKE_TM(time, tobj);
return INT2FIX(tobj->vtm.mday);
}
Alias of #mday
Returns the integer day of the month for self, in range (1..31):
Example
t = Time.new(2000, 1, 2, 3, 4, 5, 6) # => 2000-01-02 03:04:05 +000006 t.mday # => 2