简单类型 / 日期和时间

require 'date'

today = Date.today()
yesterday = today.prev_day
tomorrow = today.next_day
nextMonth = today.next_month
nextYear = today.next_year

puts "today is '#{today}'"
puts "yesterday is '#{yesterday}'"
puts "tomorrow is '#{tomorrow}'"
puts "nextMonth is '#{nextMonth}'"
puts "nextYear is '#{nextYear}'"