You can, for example, create a time object
old_time = Time.now
Then create a new time object based on this
new_time = Time.local(old_time.year, (old_time.month - 1), old_time.day, old_time.hour, old_time.min, old_time.sec)
However, as deceze pointed out, what is the criterion for 5/31 that becomes 4/30? In irb, 4/31 'overflows' to 5/01.
source share