Skip to content

Commit

Permalink
Ruby 1.9: fix Time#beginning_of_day inaccuracy due to subtracting a F…
Browse files Browse the repository at this point in the history
…loat
  • Loading branch information
jeremy committed Sep 13, 2009
1 parent 63f9426 commit a60779f
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -201,7 +201,8 @@ def next_week(day = :monday)

# Returns a new Time representing the start of the day (0:00)
def beginning_of_day
(self - self.seconds_since_midnight).change(:usec => 0)
#(self - seconds_since_midnight).change(:usec => 0)
change(:hour => 0, :min => 0, :sec => 0, :usec => 0)
end
alias :midnight :beginning_of_day
alias :at_midnight :beginning_of_day
Expand Down

0 comments on commit a60779f

Please sign in to comment.