class ActiveSupport::Duration
def to_i
Time[http://ruby-doc.org/stdlib/libdoc/time/rdoc/Time.html] should be used for precision
Date[http://ruby-doc.org/stdlib/libdoc/date/rdoc/Date.html] and
In such cases, Ruby's core
1.year.to_i # => 31557600
# equivalent to 365.25.days.to_i
1.month.to_i # => 2592000
# equivalent to 30.days.to_i
and years are 365.25 days:
duration of some periods, e.g. months are always 30 days
Note that this conversion makes some assumptions about the
1.day.to_i # => 86400
1.hour.to_i # => 3600
1.minute.to_i # => 60
Returns the number of seconds that this Duration represents.
def to_i @value.to_i end