Finding Today's Date : now « Time « Ruby





Finding Today's Date


puts now = Time.now
puts now.gmtime

# The original object was affected by the time zone conversion.
puts now

 

Related examples in the same category

1.Time.now creates an instance of class Time that's set to the current time.
2.manipulate time objects by adding and subtracting numbers of seconds to them.