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#sunday?

time.sunday? → true or false

Returns true if time represents Sunday.

Example
t = Time.local(1990, 4, 1)       #=> 1990-04-01 00:00:00 -0600
t.sunday?                        #=> true
See also #subsec #thursday? #strftime #to_a also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0