Hi so in ruby im trying to make a program that takes an argument and returns the date exactly "x" number of months ago, I got it to say the year month and date but couldn't get it to display the hours minutes and seconds. any suggestions? Thanks
require "Time"
require "Date"
class "Time"
def months_ago(n)
y = Time.now.year
d = Time.now.day
mn = Time.now.month
s = Time.now.sec
h = Time.now.hour
m = Date.civil(y, mn, d)
m <<(n)
end
end
a = Time.new.months_ago(4)
puts a