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#yday

time.yday → integer

Returns an integer representing the day of the year, 1..366.

Example
t = Time.now   #=> 2007-11-19 08:32:31 -0600
t.yday         #=> 323
See also #xmlschema #year #wednesday? #zone also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.0