Skip to content

End of Life Ruby 3.1 has reached end of life and gets no more fixes. Switch to Ruby 4.0 →

instance method

Time#mday

time.mday → integer

Returns the day of the month (1..31) for time.

Example
t = Time.now   #=> 2007-11-19 08:27:03 -0600
t.day          #=> 19
t.mday         #=> 19
See also #localtime #min #iso8601 #mon also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0