aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorVijay Dev <vijaydev.cse@gmail.com>2015-10-05 00:28:08 +0530
committerVijay Dev <vijaydev.cse@gmail.com>2015-10-05 00:28:08 +0530
commit5c2f182e2d56a92afffbd31253dbae1edf5f08ab (patch)
tree6467264572f37b83e4bdbb372f889a4d6eaf3043 /activesupport
parent5dfc7a90064c4dcb6b4f46616bb05f96e26c941d (diff)
parent73057f211533a2df3fb73d2c16276208e7fb6f2f (diff)
downloadrails-5c2f182e2d56a92afffbd31253dbae1edf5f08ab.tar.gz
rails-5c2f182e2d56a92afffbd31253dbae1edf5f08ab.tar.bz2
rails-5c2f182e2d56a92afffbd31253dbae1edf5f08ab.zip
Merge pull request #21868 from tanmay3011/fix_time_class_documentation
[ci skip] Fix #seconds_since_midnight documentation output it will al…
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/time/calculations.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/core_ext/time/calculations.rb b/activesupport/lib/active_support/core_ext/time/calculations.rb
index e403289715..82e003fc3b 100644
--- a/activesupport/lib/active_support/core_ext/time/calculations.rb
+++ b/activesupport/lib/active_support/core_ext/time/calculations.rb
@@ -51,9 +51,9 @@ class Time
# Returns the number of seconds since 00:00:00.
#
- # Time.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0
- # Time.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296
- # Time.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399
+ # Time.new(2012, 8, 29, 0, 0, 0).seconds_since_midnight # => 0.0
+ # Time.new(2012, 8, 29, 12, 34, 56).seconds_since_midnight # => 45296.0
+ # Time.new(2012, 8, 29, 23, 59, 59).seconds_since_midnight # => 86399.0
def seconds_since_midnight
to_i - change(:hour => 0).to_i + (usec / 1.0e+6)
end