Skip to content

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

instance method

Time#wday

wday → integer

Returns the integer day of the week for self, in range (0..6), with Sunday as zero.

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

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

See also #utc_offset #wednesday? #utc? #xmlschema also in 4.1 · 4.0 · 3.4 · 3.3 · 3.1 · 3.0