Created
May 29, 2013 17:05
-
-
Save leviwilson/5671934 to your computer and use it in GitHub Desktop.
String#to_american_date extension
This file contains 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
require 'date' | |
class String | |
def to_american_date | |
Date.strptime(self, '%m/%d/%Y') | |
end | |
end | |
"06/05/2013".to_american_date #=> #<Date: 2013-06-05 ((2456449j,0s,0n),+0s,2299161j)> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment