Date

hi all,
i have used date_select in my rhtml…
when i read the parameters in the controller, it returns as an arrry
like
xxx(1i)=>2007, xxx(2i)=>2, xxx(3i)=>7
i want to find out the day of that particular date
if there any posibility to get that one…

if anyone knows guide me…

Madhankumar Nagaraj wrote:

hi all,
i have used date_select in my rhtml…
when i read the parameters in the controller, it returns as an arrry
like
xxx(1i)=>2007, xxx(2i)=>2, xxx(3i)=>7
i want to find out the day of that particular date
if there any posibility to get that one…

if anyone knows guide me…

Hi,

AR will parse automatically your hash and create a Date object. So, if
you date belongs to Person.created_on attribute for instance, you just
need to do:

person = Person.new(params[:person])
day_you_were_looking_for = person.created_on.day.

Regards,
Jean-Etienne
http://www.woa.hu

dear sir,
i am very happy to inform u that, i got the result what i expected…
just 1 month before only i started to learn ruby.
thank u for ur kind help.

ur
Madhan

Jean-Etienne D. wrote:

Madhankumar Nagaraj wrote:

hi all,
i have used date_select in my rhtml…
when i read the parameters in the controller, it returns as an arrry
like
xxx(1i)=>2007, xxx(2i)=>2, xxx(3i)=>7
i want to find out the day of that particular date
if there any posibility to get that one…

if anyone knows guide me…

Hi,

AR will parse automatically your hash and create a Date object. So, if
you date belongs to Person.created_on attribute for instance, you just
need to do:

person = Person.new(params[:person])
day_you_were_looking_for = person.created_on.day.

Regards,
Jean-Etienne
http://www.woa.hu

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs