# Getting value from time\_select

**URL:** <https://www.ruby-forum.com/t/getting-value-from-time-select/150439>\
**Category:** Rails\
**Created:** [October 8, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/getting-value-from-time-select/150439 "2008-10-08T16:32:57Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 8, 2008, 4:32pm UTC](https://www.ruby-forum.com/t/getting-value-from-time-select/150439/1 "2008-10-08T16:32:57Z")

</div>

When I try to get the value of a time\_select into a flash[:notice], just  
to check it, I get nil. What ever I try I can’t deal with it. It goes  
into the db alright as mysql time, so that’s fine (e.g. 10:00:00).

Could someone explain what type the params is coming from a time\_select?  
Is it a time object or string or what?

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 8, 2008, 4:46pm UTC](https://www.ruby-forum.com/t/getting-value-from-time-select/150439/2 "2008-10-08T16:46:41Z")

</div>

On 8 Oct 2008, at 15:32, Pål Bergström wrote:

> When I try to get the value of a time\_select into a flash[:notice],  
> just  
> to check it, I get nil. What ever I try I can’t deal with it. It goes  
> into the db alright as mysql time, so that’s fine (e.g. 10:00:00).
> 
> Could someone explain what type the params is coming from a  
> time\_select?  
> Is it a time object or string or what?

Neither. it’s a set of three (two if you don’t have seconds)  
parameters called stuff like start(1i), start(2i). Peek at your logs  
to see exactly what the parameters are.

Fred

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 8, 2008, 5:04pm UTC](https://www.ruby-forum.com/t/getting-value-from-time-select/150439/3 "2008-10-08T17:04:52Z")

</div>

Frederick C. wrote:

> On 8 Oct 2008, at 15:32, Pï¿½l Bergstrï¿½m wrote:
> 
> > When I try to get the value of a time\_select into a flash[:notice],  
> > just  
> > to check it, I get nil. What ever I try I can’t deal with it. It goes  
> > into the db alright as mysql time, so that’s fine (e.g. 10:00:00).
> > 
> > Could someone explain what type the params is coming from a  
> > time\_select?  
> > Is it a time object or string or what?
> 
> Neither. it’s a set of three (two if you don’t have seconds)  
> parameters called stuff like start(1i), start(2i). Peek at your logs  
> to see exactly what the parameters are.
> 
> Fred

Yes I saw that. But when I try params[:calendar]:start\_time it  
doesn’t work.

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 8, 2008, 5:10pm UTC](https://www.ruby-forum.com/t/getting-value-from-time-select/150439/4 "2008-10-08T17:10:51Z")

</div>

On 8 Oct 2008, at 16:04, PÃ¥l BergstrÃ¶m wrote:

> > >
> 
> Yes I saw that. But when I try params[:calendar]:start\_time it  
> doesn’t work.

params[:calendar][:‘start\_time(4i)’]

Fred

---

<div class="post-metadata">

**Author:** ![paulbutcher](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/a5b964/32.png) [@paulbutcher](https://www.ruby-forum.com/u/paulbutcher)\
**Post date:** [October 8, 2008, 5:35pm UTC](https://www.ruby-forum.com/t/getting-value-from-time-select/150439/5 "2008-10-08T17:35:13Z")

</div>

Frederick C. wrote:

> On 8 Oct 2008, at 16:04, PÃ¥l BergstrÃ¶m wrote:
> 
> > > >
> > 
> > Yes I saw that. But when I try params[:calendar]:start\_time it  
> > doesn’t work.
> 
> params[:calendar][:‘start\_time(4i)’]
> 
> Fred

Works. Thanks 🙂
