Skip to content

Commit

Permalink
[ci skip] Fix #seconds_since_midnight documentation output it will al…
Browse files Browse the repository at this point in the history
…ways return floating pointnumber
  • Loading branch information
tanmay3011 committed Oct 4, 2015
1 parent 67597e1 commit 73057f2
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -51,9 +51,9 @@ def at_with_coercion(*args)

# 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
Expand Down

0 comments on commit 73057f2

Please sign in to comment.