File: tz_all.rb

package info (click to toggle)
ruby-rufus-scheduler 3.8.2-3
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 524 kB
  • sloc: ruby: 4,324; makefile: 26
file content (21 lines) | stat: -rw-r--r-- 381 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21

require 'tzinfo'
# if tzinfo-data is installed, tzinfo picks it up
# automatically

#TZInfo::Timezone.all.each { |tz| puts tz.name }

tzs = TZInfo::Timezone.all.sort_by { |tz| tz.name.length }
puts "TIMEZONES = %["
l = 0
tzs.each do |tz|
  if l + tz.name.length > 79
    puts; l = 0
  elsif l > 0
    print ' '; l += 1
  end
  l += tz.name.length
  print tz.name;
end
puts "\n]"