1
That is the code:
require 'time'
t = Time.parse('2016-04-18') #data de ontém
t2 = Time.now #data atual
t3 = t2 - t # subtração das duas variáveis(datas) acima
puts Time.at(t3) #resultado da subtração
In this case the result should be a day and a few hours, but the program returns me that date: "1970-01-02 08:00:42 -0300". I don’t know where I’m going wrong.
Perfect! It was just that!. Thank you very much!
– Constantinologia
@Constantinology I thank for the choice ;)
– JeffBusterCase