diff options
author | Tanmay Sinha <tanmay3011@gmail.com> | 2015-10-05 00:06:01 +0530 |
---|---|---|
committer | Tanmay Sinha <tanmay3011@gmail.com> | 2015-10-05 00:06:01 +0530 |
commit | 73057f211533a2df3fb73d2c16276208e7fb6f2f (patch) | |
tree | 0fd9688437f2f9d3308c697c3527f50c91efd853 /activesupport/lib/active_support | |
parent | 67597e1719ec6af7e22964603cc77aa5b085a864 (diff) | |
download | rails-73057f211533a2df3fb73d2c16276208e7fb6f2f.tar.gz rails-73057f211533a2df3fb73d2c16276208e7fb6f2f.tar.bz2 rails-73057f211533a2df3fb73d2c16276208e7fb6f2f.zip |
[ci skip] Fix #seconds_since_midnight documentation output it will always return floating pointnumber
Diffstat (limited to 'activesupport/lib/active_support')
-rw-r--r-- | activesupport/lib/active_support/core_ext/time/calculations.rb | 6 |
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 f13d09f3ad..9677af57d9 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 |