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 Aug 22, 2009
1 parent b58acea commit e93d0a5
Showing 1 changed file with 2 additions and 1 deletion.
Expand Up @@ -172,7 +172,8 @@ def next_week(day = :monday)

# Returns a new Time representing the start of the day (0:00)
def beginning_of_day
(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

1 comment on commit e93d0a5

@ujihisa
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool

Please sign in to comment.