Tuesday, November 19, 2013

Re: [Rails] ActiveRecord simple question about date

On Tue, Nov 19, 2013 at 10:36 AM, rusik <rusik3@gmail.com> wrote:
> yes, it is string.

Uh, well.

If the datatype of that column were String, would you think you'd
be likely to get different results from bdate and bdate.to_s?

>> >> User.find(2).bdate
>> >> => Wed, 09 May 1945
>> >> User.find(2).bdate.to_s
>> >> => "1945-05-09"

--
Hassan Schroeder ------------------------ hassan.schroeder@gmail.com
http://about.me/hassanschroeder
twitter: @hassan

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/CACmC4yBrz8Z1c7XdHDyGO6ozgWPvCUKyTWN3-uSX0_O4DaJMDQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate