I want a block of code to be executed, with the following condition:
In a variable I have saved a timestamp, ex. @tiempo
date: 2018-06-11 18:04:25 -0500, and the current time is # => 2018-06-13 18:04:25 -0500
If the difference between the variable @tiempo
and the current time is 2 days, execute the following code, if not, execute another block of code, something like this:
if @tiempo.days_ago(2).from.now
# ejecutar un bloque de código
else
# otro código
end
How could I do it?
Thank you.