I have an application that was working in ruby 1.8.7 When i switched to ruby 1.9.2 i can no longer import into my database.The date format seems to have changed, but i cant change my data, from mm/dd/yyyy. It seems ruby is using dd/mm/yyyy. I am importing data via csv that i can’t change. I have tried run my original seed file with rake db:seed and have the same problem. How do i force the change so i can import dates in to my app.
The date format seems to have changed but i can change my data. from mm/dd/yyyy
it seems ruby is using dd/mm/yyyy
I am importing data via csv that i can’t change.
I have tried run my original seed file with rake db:seed and have the same problem.
i Need force the change so i can import dates in to my app.
Try something like this
.strptimeparses the date, then.to_s(:db)converts it into a database-friendly format.