Rails Time Zone Select (time_zone_select) Australian Priority

Handy little bit that I picked up when using the time_zone_select form helper.

You’re able to set priority zones that appear at the top of the timezone select list so for my app I was looking to have the Australian timezones appear at the top.

For the US they provide a neat little method:

<%= f.time_zone_select :time_zone, ActiveSupport::TimeZone.us_zones %>

But for other countries the way of implementing this is different, and here’s what I found works:

<%= f.time_zone_select :time_zone, /Australia/ %>