Skip to content

Maintenance Ruby 3.4 gets fixes, but no new features. Switch to Ruby 4.0 →

instance method

Time#mon

() -> ::Integer
mon → integer

Returns the integer month of the year for self, in range (1..12):

Example
t = Time.new(2000, 1, 2, 3, 4, 5, 6)
# => 2000-01-02 03:04:05 +000006
t.mon # => 1

Related: Time#year, Time#hour, Time#min.

See also #min #monday? #mday #month also in 4.1 · 4.0 · 3.3 · 3.2 · 3.1 · 3.0