Created
December 20, 2013 16:49
-
-
Save elkelk/8057670 to your computer and use it in GitHub Desktop.
Strip milliseconds from time in ruby.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5.days.ago.change(:usec => 0) |
This only works with ActiveSupport fyi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Source: http://ilikestuffblog.com/2010/05/18/how-to-truncate-a-ruby-time-down-to-the-second-minute-hour-or-day/