# Time\_zone\_select

**URL:** <https://www.ruby-forum.com/t/time-zone-select/124758>\
**Category:** Rails\
**Created:** [January 2, 2008, 10:01am UTC](https://www.ruby-forum.com/t/time-zone-select/124758 "2008-01-02T10:01:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ss\_1982](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@ss\_1982](https://www.ruby-forum.com/u/ss_1982)\
**Post date:** [January 2, 2008, 10:01am UTC](https://www.ruby-forum.com/t/time-zone-select/124758/1 "2008-01-02T10:01:10Z")

</div>

Hi,

I am using the tzinfo gem and plugins to manage time zone support in my  
app.

In one of the views I have the following select  
\<%= time\_zone\_select ‘user’, ‘time\_zone’, TZInfo::Timezone.all.sort,  
:model =\> TZInfo::Timezone %\>

This produces a list of all possible countries, does anyone know of a  
way to only display the UTC + / - options and not the named places?

thanks

---

<div class="post-metadata">

**Author:** ![ss\_1982](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/96bed5/32.png) [@ss\_1982](https://www.ruby-forum.com/u/ss_1982)\
**Post date:** [January 2, 2008, 10:17pm UTC](https://www.ruby-forum.com/t/time-zone-select/124758/2 "2008-01-02T22:17:51Z")

</div>

On 1/2/08, Scott A S [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I am using the tzinfo gem and plugins to manage time zone support in my  
> app.
> 
> In one of the views I have the following select  
> \<%= time\_zone\_select ‘user’, ‘time\_zone’, TZInfo::Timezone.all.sort,  
> :model =\> TZInfo::Timezone %\>
> 
> This produces a list of all possible countries, does anyone know of a  
> way to only display the UTC + / - options and not the named places?

I’m not familiar with the tzinfo gem but you should be able to use  
something like this:

TZInfo::Timezone.all.sort.collect { |tz| [tz.name] }

–  
Greg D.  
[http://destiney.com/](http://destiney.com/)
