Skip to content

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

class method

Time.now

Time.now → time

Creates a new Time object for the current time. This is same as Time.new without arguments.

Example
Time.now            #=> 2009-06-24 12:39:54 +0900
See also .new .parse .month_days .rfc2822 also in 4.1 · 4.0 · 3.4 · 3.3 · 3.2 · 3.1