Flowdock
ago(time = ::Time.current) public

Calculates a new Time or Date that is as far in the past as this Duration represents.

Show source
Register or log in to add new notes.
July 2, 2014
0 thanks

time is represented in the Rails app's timezone

From the description of Time.current (which is a Rails extension of Ruby’s native Time class)

“Returns Time.zone.now when Time.zone or config.time_zone are set, otherwise just returns Time.now.”

so 3.days.ago, for example, is in the application’s configured timezone (if it’s configured).