manipulate time objects by adding and subtracting numbers of seconds to them. : now « Time « Ruby






manipulate time objects by adding and subtracting numbers of seconds to them.


puts Time.now
puts Time.now - 10
puts Time.now + 86400

 








Related examples in the same category

1.Time.now creates an instance of class Time that's set to the current time.
2.Finding Today's Date