前日・翌日の取得

Dateを使うと簡単です。

require 'date'

today = Date.today

nextday = today + 1
yesterday = today - 1

puts nextday.to_s
puts yesterday.to_s

Date#succDate#nextで翌日を取得できます。

require 'date'

today = Date.today

nextday = today.succ

puts nextday.to_s

関連項目