Ruby/Time/now

Материал из Wiki.crossplatform.ru

Перейти к: навигация, поиск

Finding Today"s Date

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



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

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



Time.now creates an instance of class Time that"s set to the current time.

puts Time.now