In Ruby, we can use the
Time.now method to get the current system time. We can also use it to create a new time object from the current system time.
This method does not take any parameters.
Time.now method returns the current system time when it is called.
# print current time puts Time.now # create new time object a = Time.now # print result puts a
Time.nowmethod to create a new time object.
View all Courses