APIdock / Ruby on Rails
/
Browse About
method

seconds_until_end_of_day

v5.2.3 - Show latest stable - Class: Time
seconds_until_end_of_day()
public

Returns the number of seconds until 23:59:59.

Time.new(2012, 8, 29,  0,  0,  0).seconds_until_end_of_day # => 86399
Time.new(2012, 8, 29, 12, 34, 56).seconds_until_end_of_day # => 41103
Time.new(2012, 8, 29, 23, 59, 59).seconds_until_end_of_day # => 0
# File activesupport/lib/active_support/core_ext/time/calculations.rb, line 97
  def seconds_until_end_of_day
    end_of_day.to_i - to_i
  end

Related methods

  • Instance methods
  • +
  • -
  • <=>
  • acts_like_time?
  • advance
  • ago
  • as_json
  • at_beginning_of_day
  • at_beginning_of_hour
  • at_beginning_of_minute
  • at_end_of_day
  • at_end_of_hour
  • at_end_of_minute
  • at_midday
  • at_middle_of_day
  • at_midnight
  • at_noon
  • beginning_of_day
  • beginning_of_hour
  • beginning_of_minute
  • blank?
  • change
  • compare_with_coercion
  • compare_without_coercion
  • end_of_day
  • end_of_hour
  • end_of_minute
  • eql?
  • eql_with_coercion
  • eql_without_coercion
  • formatted_offset
  • in
  • midday
  • middle_of_day
  • midnight
  • minus_with_coercion
  • minus_with_duration
  • minus_without_coercion
  • minus_without_duration
  • noon
  • plus_with_duration
  • plus_without_duration
  • sec_fraction
  • seconds_since_midnight
  • seconds_until_end_of_day
  • since
  • to_default_s
  • to_formatted_s
  • to_s
  • to_time
  • Class methods
  • ===
  • at
  • at_with_coercion
  • at_without_coercion
  • current
  • days_in_month
  • days_in_year
  • find_zone
  • find_zone!
  • rfc3339
  • use_zone
  • zone
  • zone=
APIdock API Documentation Browser

© 2026 APIdock