since(seconds)
public
Returns a new Time representing the time a number
of seconds since
the instance time, this is basically a wrapper around the Numeric extension.
# File activesupport/lib/active_support/core_ext/time/calculations.rb, line 124
def since(seconds)
f = seconds.since(self)
if ActiveSupport::Duration === seconds
f
else
initial_dst = self.dst? ? 1 : 0
final_dst = f.dst? ? 1 : 0
(seconds.abs >= 86400 && initial_dst != final_dst) ? f + (initial_dst - final_dst).hours : f
end
rescue
self.to_datetime.since(seconds)
end