Yannick Yanikos wrote:
> Hello,
> 
> I have a problem with date when saving into my sql with rails 3.
> 
> Into my environment.rb file i put Date::DATE_FORMATS[:default] =
> "%d/%m/%Y"
> 
> i created a jquery calendar and into the text field the date is for
> example 01/10/2010.
> When i save, the date saved is  10/01/2010. the monthes and the days are
> inversed.
> 
> 
> into the log parameter is  : "birthday"=>"01/10/2010"
> 
> and the update (db) :   UPDATE `profiles` SET `birthday` = '2010-01-10'
> ...
> 
> format is saved as MM/DD/YYYY
> 
> Does anyone know how to make this work ?
> 
> Thank you.

I have also seen this problem. The DATE_FORMATS line seems to only tell 
Rails that you want dates displayed this way. Mysql does whatever it 
wants and ignores the instructions. There are a few ways that claim to 
change this behavior on the web, but none have worked for me yet. I'd 
love to see an answer to this problem. The inversed date is because 
dates are shown that way in Europe and that is the way Mysql sees them.

Bob <bsm...@gmail.com>
-- 
Posted via http://www.ruby-forum.com/.

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-t...@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to