Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →
instance method
Time#sunday?
sunday? → true or false
time.c
View on GitHub ↗
static VALUE
time_sunday(VALUE time)
{
wday_p(0);
}
Returns true if self represents a Sunday, false otherwise:
Example
t = Time.utc(2000, 1, 2) # => 2000-01-02 00:00:00 UTC t.sunday? # => true
Related: Time#monday?, Time#tuesday?, Time#wednesday?.