Created
October 6, 2017 02:29
-
-
Save anonymous/8d7670dba208ffa22041e0275ca62139 to your computer and use it in GitHub Desktop.
syntax error
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
params = {} | |
params[:date] = "2017-010-29" | |
def get_correct_date | |
if params != nil && params[:date] != nil | |
dateArray = params[:date].split("-") | |
if dateArray[1].length > 2 dateArray[1] = dateArray[1].last(2) | |
end params[:date] = dateArray[0] + "-" + dateArray[1] + "-" + dateArray[2] | |
end | |
end | |
get_correct_date | |
print params[:date] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment