Try the following:
(DateTime.now - 1.month).strftime("%FT%T").to_s
PS: I'm sure this works great with rails. Please confirm that it works regardless of ruby ββtoo?
UPDATE
As indicated below, this will only work if you have activesupportlib
source
share