instance method
seconds_until_end_of_day
Ruby on Rails 7.1.6
Since v4.0.13Signature
seconds_until_end_of_day()
Returns the number of seconds until 23:59:59.
DateTime.new(2012, 8, 29, 0, 0, 0).seconds_until_end_of_day # => 86399 DateTime.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103 DateTime.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0
Source
# File activesupport/lib/active_support/core_ext/date_time/calculations.rb, line 29
def seconds_until_end_of_day
end_of_day.to_i - to_i
end
Defined in activesupport/lib/active_support/core_ext/date_time/calculations.rb line 29
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in DateTime