# Time\_zone\_select() Trouble

**URL:** <https://www.ruby-forum.com/t/time-zone-select-trouble/131294>\
**Category:** Rails\
**Created:** [March 7, 2008, 7:04pm UTC](https://www.ruby-forum.com/t/time-zone-select-trouble/131294 "2008-03-07T19:04:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![david](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/aeb1de/32.png) [@david](https://www.ruby-forum.com/u/david)\
**Post date:** [March 7, 2008, 7:04pm UTC](https://www.ruby-forum.com/t/time-zone-select-trouble/131294/1 "2008-03-07T19:04:39Z")

</div>

I am having a lot of trouble getting my time zone select to default to  
the user’s previously selected time zone. Here’s my code:

\<%= time\_zone\_select :other, :time\_zone,  
TimeZone.us\_zones,  
:selected =\> cookies[:time\_zone] %\>

This didn’t work, so I checked all my cookie action (which seems fine)  
and finally tried the following just to see if it was working at all:

\<%= time\_zone\_select :other, :time\_zone,  
TimeZone.us\_zones,  
:selected =\> “Hawaii” %\>

That doesn’t work either. Any ideas?

Here’s what the API says about it:

> **[ActionView::Helpers::FormOptionsHelper](https://api.rubyonrails.org/classes/ActionView/Helpers/FormOptionsHelper.html#M000943)**
>
> Provides a number of methods for turning different kinds of containers into a set of option tags.
