[TZInfo-users] GMT definitions
Philip Ross
phil.ross at gmail.com
Wed Apr 16 06:52:38 EDT 2008
Hi,
On 16/04/2008, Gianpaolo D'Ambra <gpdambra at gmail.com> wrote:
> I use this for generating my list:
>
> <%= time_zone_options_for_select (current_user.time_zone,
> TZInfo::Timezone.all_country_zones.sort) %>
You need to specify the model parameter to make
time_zone_options_for_select work with TZInfo:
<%= time_zone_options_for_select(current_user.time_zone, nil,
TZInfo::Timezone) %>
The second parameter is actually a list of priority zones rather than
the complete list, so does not need to be specified.
> At the moment I didn't find anything better. "My wish" is to list only
> '(GMT+02:00) *city*' but with th correct values, but I haven't found
> anything googling. Could you help me?
The above code will give you a list of all the timezones, but probably
not in the format you want. You may want to take a look at the Rails
TzinfoTimezone and TzTime plugins to see if they do what you need.
Regards,
Phil
--
Phil Ross
http://tzinfo.rubyforge.org/ -- DST-aware timezone library for Ruby
More information about the TZInfo-users
mailing list