Please help me with the code i.e how to get Last day of Last month.
i.e. if today date is 06-11-2016 (dd-mm-yyyy) => output: 31-10-2016
Anything like this?
require 'date'
t = Date.today
Date.new(t.year, t.month) - 1
=> #<Date: 2016-10-31 ((2457693j,0s,0n),+0s,2299161j)>