require 'date' # today today = DateTime.now.strftime('%Y-%m-%d') # yesterday yesterday = (DateTime.now - 1).strftime('%Y-%m-%d') # 1 month ago monthago = (DateTime.now << 1).strftime('%Y-%m-%d') # 3 month ago threemonthago = (DateTime.now << 3).strftime('%Y-%m-%d')