I want to create a DateTime instance that lies 20 minutes and 10 seconds in the future. I tried around with Time and DateTime in irb, but can\'t seem to figure out a way that re
Assuming you have required Active Support or you're working in a Rails project. A very simple and readable way to do this in Ruby is:
DateTime + 5.minutes Time + 5.minutes
Also works with seconds, hours, days, weeks, months, years.
seconds
hours
days
weeks
months
years