timezone 1.3.6 → 1.3.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (85) hide show
  1. checksums.yaml +4 -4
  2. data/.travis.yml +1 -0
  3. data/CHANGES.markdown +20 -0
  4. data/CONTRIBUTING.markdown +8 -2
  5. data/Rakefile +3 -1
  6. data/benchmark.rb +16 -29
  7. data/data/Africa/Accra +61 -47
  8. data/data/Africa/Addis_Ababa +5 -4
  9. data/data/Africa/Algiers +2 -2
  10. data/data/Africa/Asmara +5 -4
  11. data/data/Africa/Asmera +5 -4
  12. data/data/Africa/Bangui +4 -1
  13. data/data/Africa/Brazzaville +4 -1
  14. data/data/Africa/Casablanca +11 -11
  15. data/data/Africa/Dar_es_Salaam +5 -4
  16. data/data/Africa/Djibouti +5 -4
  17. data/data/Africa/Douala +4 -1
  18. data/data/Africa/El_Aaiun +11 -11
  19. data/data/Africa/Kampala +5 -4
  20. data/data/Africa/Kinshasa +4 -1
  21. data/data/Africa/Lagos +4 -1
  22. data/data/Africa/Libreville +4 -1
  23. data/data/Africa/Luanda +4 -1
  24. data/data/Africa/Malabo +4 -1
  25. data/data/Africa/Mogadishu +5 -4
  26. data/data/Africa/Nairobi +5 -4
  27. data/data/Africa/Niamey +4 -1
  28. data/data/Africa/Porto-Novo +4 -1
  29. data/data/America/Belize +44 -1
  30. data/data/America/Dawson +2 -38
  31. data/data/America/Grand_Turk +1 -2
  32. data/data/America/Nassau +6 -1
  33. data/data/America/Nuuk +120 -0
  34. data/data/America/Whitehorse +2 -38
  35. data/data/Antarctica/Casey +6 -1
  36. data/data/Antarctica/Macquarie +58 -3
  37. data/data/Asia/Chongqing +3 -1
  38. data/data/Asia/Chungking +3 -1
  39. data/data/Asia/Gaza +58 -56
  40. data/data/Asia/Harbin +3 -1
  41. data/data/Asia/Hebron +58 -56
  42. data/data/Asia/Jerusalem +34 -32
  43. data/data/Asia/Shanghai +3 -1
  44. data/data/Asia/Tel_Aviv +34 -32
  45. data/data/Atlantic/Bermuda +29 -2
  46. data/data/Australia/ACT +9 -9
  47. data/data/Australia/Adelaide +9 -9
  48. data/data/Australia/Brisbane +9 -9
  49. data/data/Australia/Broken_Hill +9 -9
  50. data/data/Australia/Canberra +9 -9
  51. data/data/Australia/Currie +22 -10
  52. data/data/Australia/Darwin +8 -8
  53. data/data/Australia/Eucla +7 -7
  54. data/data/Australia/Hobart +12 -8
  55. data/data/Australia/Lindeman +9 -9
  56. data/data/Australia/Melbourne +9 -9
  57. data/data/Australia/NSW +9 -9
  58. data/data/Australia/North +8 -8
  59. data/data/Australia/Perth +7 -7
  60. data/data/Australia/Queensland +9 -9
  61. data/data/Australia/South +9 -9
  62. data/data/Australia/Sydney +9 -9
  63. data/data/Australia/Tasmania +12 -8
  64. data/data/Australia/Victoria +9 -9
  65. data/data/Australia/West +7 -7
  66. data/data/Australia/Yancowinna +9 -9
  67. data/data/Canada/Yukon +2 -38
  68. data/data/Europe/Budapest +24 -24
  69. data/data/Europe/Monaco +3 -3
  70. data/data/Europe/Paris +3 -3
  71. data/data/Europe/Volgograd +2 -1
  72. data/data/Indian/Antananarivo +5 -4
  73. data/data/Indian/Comoro +5 -4
  74. data/data/Indian/Mahe +1 -1
  75. data/data/Indian/Mayotte +5 -4
  76. data/data/Israel +34 -32
  77. data/data/PRC +3 -1
  78. data/data/Pacific/Efate +5 -3
  79. data/data/Pacific/Fiji +2 -2
  80. data/lib/timezone/parser.rb +28 -14
  81. data/lib/timezone/version.rb +1 -1
  82. data/test/timezone/test_zone.rb +4 -4
  83. data/timezone.gemspec +0 -2
  84. metadata +8 -8
  85. data/data/US/Pacific-New +0 -189
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 68f35118b503fa8db7cdbbeb4691936ec71c7a28fbbd9a0a80f79b377eec479e
4
- data.tar.gz: cd768dc292c6a383abbe03a2cbcdc1cecad86270789d775af510b97a6b4c2388
3
+ metadata.gz: 3b3d58fa076590b65bbed8e8e815a9e69d937cfc0084e5d326c04ecefdec9840
4
+ data.tar.gz: 1abc8e54dd2bd3e4e102d15dae0e148afa048cc16aba3e451266163c41f4f561
5
5
  SHA512:
6
- metadata.gz: aaa1f6a923f125b639d4a46f244e796b361260edd6c73d3b7726f8761ed30dea3db486788fa06aca6a6477ba8225fd8f441a7da7b5c5387cf73bd560a23f1b0f
7
- data.tar.gz: 5d6508634b2aeec751c53118c008d9a2c1fc2895a24afd21aa24e5cecbbc88ff7e5af6d82ea165cb50e485634f5cde4eb5c53d447571936fad25669195e2ccb6
6
+ metadata.gz: 864742245bc0034ed2d5fe406af7aa34b6ecf834d3c8228a95d9e39d51b0670a603b9d3fec802d48ed63e43c9997d294544b3a59009995d292d6a9d42ea6c691
7
+ data.tar.gz: a04acff32993eda51495350dc8c61b2f3a5537d4fdc8672045508fdd786b936a29461472f69354fe5434687187af8a5c46e27774bc1ad91a756f7db114978354
@@ -10,3 +10,4 @@ rvm:
10
10
  - 2.4
11
11
  - 2.5
12
12
  - 2.6
13
+ - 2.7
@@ -1,5 +1,25 @@
1
1
  # master (unreleased)
2
2
 
3
+ # 1.3.11
4
+
5
+ * Updated with `tzdata-2020f` ([@panthomakos][])
6
+
7
+ # 1.3.10
8
+
9
+ * Updated with `tzdata-2020d` ([@panthomakos][])
10
+
11
+ # 1.3.9
12
+
13
+ * Updated with `tzdata-2020c` ([@panthomakos][])
14
+
15
+ # 1.3.8
16
+
17
+ * Updated with `tzdata-2020b` ([@panthomakos][])
18
+
19
+ # 1.3.7
20
+
21
+ * Updated with `tzdata-2020a` ([@panthomakos][])
22
+
3
23
  # 1.3.6
4
24
 
5
25
  * Updated with `tzdata-2019c-1` ([@panthomakos][])
@@ -6,8 +6,14 @@
6
6
 
7
7
  # How to Acquire New TZData Information
8
8
 
9
- * Ensure system `tzdata` package is up to date with most recent release from [IANA](http://www.iana.org/time-zones).
10
- * Run `bundle exec rake parse` to parse files in `posix/` directory into the local `data` directory.
9
+ * Download and unzip the IANA timezone database (code and data) into the same directory. Use the timezone database README instructions to install. For example:
10
+
11
+ make TOPDIR=$HOME/Downloads/tz install
12
+
13
+ * Provide the root directory (TOPDIR) as the TZPATH environment variable. For example:
14
+
15
+ TZPATH=$HOME/Downloads/tz bundle exec rake parse
16
+
11
17
  * Commit changes. For an example, see [this commit](https://github.com/panthomakos/timezone/commit/5815112d7a6c8740844189db0f05281e9c98f58f).
12
18
 
13
19
  # Notes
data/Rakefile CHANGED
@@ -19,7 +19,9 @@ task(:utc) { ENV['TZ'] = 'UTC' }
19
19
  task default: %i[utc test rubocop]
20
20
 
21
21
  task parse: :utc do
22
+ path = ENV['TZPATH'] || File.join(ENV['HOME'], 'Downloads', 'tz')
23
+
22
24
  require 'timezone/parser'
23
25
 
24
- Timezone::Parser.new.perform
26
+ Timezone::Parser.new(path).perform
25
27
  end
@@ -4,42 +4,29 @@
4
4
  require 'benchmark'
5
5
  require 'timezone'
6
6
 
7
- def load_tz(timezone)
8
- Timezone.fetch(timezone)
9
- end
10
-
11
7
  puts 'Loading timezones'
12
8
 
13
- LOAD_ITERATIONS = 1_000
14
9
  Benchmark.bm do |x|
15
- x.report('la') { LOAD_ITERATIONS.times { load_tz('America/Los_Angeles') } }
16
- x.report('hk') { LOAD_ITERATIONS.times { load_tz('Asia/Hong_Kong') } }
17
- end
18
-
19
- def calc_local(timezone)
20
- timezone.time(Time.utc(3000, 1, 1))
10
+ x.report('la') { 10_000.times { Timezone.fetch('America/Los_Angeles') } }
11
+ x.report('hk') { 10_000.times { Timezone.fetch('Asia/Hong_Kong') } }
21
12
  end
22
13
 
23
- puts 'Calculating LOCAL'
24
-
25
- LOCAL_ITERATIONS = 10_000
26
- Benchmark.bm do |x|
27
- timezone = Timezone.fetch('America/Los_Angeles')
28
- x.report('la') { LOCAL_ITERATIONS.times { calc_local(timezone) } }
29
- timezone = Timezone.fetch('Asia/Hong_Kong')
30
- x.report('hk') { LOCAL_ITERATIONS.times { calc_local(timezone) } }
14
+ def calc(method, timezone, time)
15
+ timezone.public_send(method, time)
31
16
  end
32
17
 
33
- def calc_utc(timezone)
34
- timezone.local_to_utc(Time.utc(3000, 1, 1))
18
+ def bench(iterations, method)
19
+ Benchmark.bm do |x|
20
+ time = Time.utc(3000, 1, 1)
21
+ timezone = Timezone.fetch('America/Los_Angeles')
22
+ x.report('la') { iterations.times { calc(method, timezone, time) } }
23
+ timezone = Timezone.fetch('Asia/Hong_Kong')
24
+ x.report('hk') { iterations.times { calc(method, timezone, time) } }
25
+ end
35
26
  end
36
27
 
37
- puts 'Calculating UTC'
28
+ puts 'Calculating LOCAL (#time)'
29
+ bench(10_000, :time)
38
30
 
39
- UTC_ITERATIONS = 10_000
40
- Benchmark.bm do |x|
41
- timezone = Timezone.fetch('America/Los_Angeles')
42
- x.report('la') { UTC_ITERATIONS.times { calc_utc(timezone) } }
43
- timezone = Timezone.fetch('Asia/Hong_Kong')
44
- x.report('hk') { UTC_ITERATIONS.times { calc_utc(timezone) } }
45
- end
31
+ puts 'Calculating UTC (#local_to_utc)'
32
+ bench(10_000, :local_to_utc)
@@ -1,48 +1,62 @@
1
- -1640995149:LMT:0:-52
2
- 84153548:GMT:0:0
3
- 10453200:+0020:1:1200
4
- 21082800:GMT:0:0
5
- 10453200:+0020:1:1200
6
- 21082800:GMT:0:0
7
- 10453200:+0020:1:1200
8
- 21082800:GMT:0:0
9
- 10453200:+0020:1:1200
10
- 21169200:GMT:0:0
11
- 10453200:+0020:1:1200
12
- 21082800:GMT:0:0
13
- 10453200:+0020:1:1200
14
- 21082800:GMT:0:0
15
- 10453200:+0020:1:1200
16
- 21082800:GMT:0:0
17
- 10453200:+0020:1:1200
18
- 21169200:GMT:0:0
19
- 10453200:+0020:1:1200
20
- 21082800:GMT:0:0
21
- 10453200:+0020:1:1200
22
- 21082800:GMT:0:0
23
- 10453200:+0020:1:1200
24
- 21082800:GMT:0:0
25
- 10453200:+0020:1:1200
26
- 21169200:GMT:0:0
27
- 10453200:+0020:1:1200
28
- 21082800:GMT:0:0
29
- 10453200:+0020:1:1200
30
- 21082800:GMT:0:0
31
- 10453200:+0020:1:1200
32
- 21082800:GMT:0:0
33
- 10453200:+0020:1:1200
34
- 21169200:GMT:0:0
35
- 10453200:+0020:1:1200
36
- 21082800:GMT:0:0
37
- 10453200:+0020:1:1200
38
- 21082800:GMT:0:0
39
- 10453200:+0020:1:1200
40
- 21082800:GMT:0:0
41
- 10453200:+0020:1:1200
42
- 21169200:GMT:0:0
43
- 10453200:+0020:1:1200
44
- 21082800:GMT:0:0
45
- 10453200:+0020:1:1200
46
- 21082800:GMT:0:0
47
- 10453200:+0020:1:1200
1
+ -1709337549:LMT:0:-52
2
+ 128131148:GMT:0:0
3
+ 3289200:+0020:1:1200
4
+ 21082800:GMT:0:0
5
+ 10539600:+0020:1:1200
6
+ 20996400:GMT:0:0
7
+ 10539600:+0020:1:1200
8
+ 20996400:GMT:0:0
9
+ 10539600:+0020:1:1200
10
+ 20996400:GMT:0:0
11
+ 10539600:+0020:1:1200
12
+ 21082800:GMT:0:0
13
+ 10539600:+0020:1:1200
14
+ 20996400:GMT:0:0
15
+ 10539600:+0020:1:1200
16
+ 20996400:GMT:0:0
17
+ 10539600:+0020:1:1200
18
+ 20996400:GMT:0:0
19
+ 10539600:+0020:1:1200
20
+ 21082800:GMT:0:0
21
+ 10539600:+0020:1:1200
22
+ 20996400:GMT:0:0
23
+ 10539600:+0020:1:1200
24
+ 20996400:GMT:0:0
25
+ 10539600:+0020:1:1200
26
+ 20996400:GMT:0:0
27
+ 10539600:+0020:1:1200
28
+ 21082800:GMT:0:0
29
+ 10539600:+0020:1:1200
30
+ 20996400:GMT:0:0
31
+ 10539600:+0020:1:1200
32
+ 20996400:GMT:0:0
33
+ 10539600:+0020:1:1200
34
+ 20996400:GMT:0:0
35
+ 10539600:+0020:1:1200
36
+ 21082800:GMT:0:0
37
+ 10539600:+0020:1:1200
38
+ 20996400:GMT:0:0
39
+ 10539600:+0020:1:1200
40
+ 20996400:GMT:0:0
41
+ 10539600:+0020:1:1200
42
+ 20996400:GMT:0:0
43
+ 10539600:+0020:1:1200
44
+ 10455600:GMT:0:0
45
+ 21166800:+0020:1:1200
46
+ 10369200:GMT:0:0
47
+ 21166800:+0020:1:1200
48
+ 3277200:GMT:0:0
49
+ 123377400:+0030:0:1800
50
+ 146802600:GMT:0:0
51
+ 10539000:+0030:1:1800
52
+ 20997000:GMT:0:0
53
+ 10539000:+0030:1:1800
54
+ 21083400:GMT:0:0
55
+ 10539000:+0030:1:1800
56
+ 20997000:GMT:0:0
57
+ 10539000:+0030:1:1800
58
+ 20997000:GMT:0:0
59
+ 10539000:+0030:1:1800
60
+ 20997000:GMT:0:0
61
+ 10539000:+0030:1:1800
48
62
  1:GMT:0:0
@@ -1,5 +1,6 @@
1
- -1309746437:LMT:0:8836
2
- 47431636:EAT:0:10800
3
- 315534600:+0230:0:9000
4
- 631151100:+0245:0:9900
1
+ -1946168837:LMT:0:8836
2
+ 636422236:+0230:0:9000
3
+ 47777400:EAT:0:10800
4
+ 220581000:+0230:0:9000
5
+ 176082300:+0245:0:9900
5
6
  1:EAT:0:10800
@@ -1,5 +1,5 @@
1
- -2486679073:LMT:0:732
2
- 630720111:PMT:0:561
1
+ -2486592733:LMT:0:732
2
+ 630633771:PMT:0:561
3
3
  166144161:WET:0:0
4
4
  9417600:WEST:1:3600
5
5
  15033600:WET:0:0
@@ -1,5 +1,6 @@
1
- -1309746437:LMT:0:8836
2
- 47431636:EAT:0:10800
3
- 315534600:+0230:0:9000
4
- 631151100:+0245:0:9900
1
+ -1946168837:LMT:0:8836
2
+ 636422236:+0230:0:9000
3
+ 47777400:EAT:0:10800
4
+ 220581000:+0230:0:9000
5
+ 176082300:+0245:0:9900
5
6
  1:EAT:0:10800
@@ -1,5 +1,6 @@
1
- -1309746437:LMT:0:8836
2
- 47431636:EAT:0:10800
3
- 315534600:+0230:0:9000
4
- 631151100:+0245:0:9900
1
+ -1946168837:LMT:0:8836
2
+ 636422236:+0230:0:9000
3
+ 47777400:EAT:0:10800
4
+ 220581000:+0230:0:9000
5
+ 176082300:+0245:0:9900
5
6
  1:EAT:0:10800
@@ -1,2 +1,5 @@
1
- -1588464817:LMT:0:816
1
+ -2035584816:LMT:0:815
2
+ 94695215:GMT:0:0
3
+ 173663185:LMT:0:815
4
+ 178760615:+0030:0:1800
2
5
  1:WAT:0:3600
@@ -1,2 +1,5 @@
1
- -1588464817:LMT:0:816
1
+ -2035584816:LMT:0:815
2
+ 94695215:GMT:0:0
3
+ 173663185:LMT:0:815
4
+ 178760615:+0030:0:1800
2
5
  1:WAT:0:3600
@@ -56,14 +56,14 @@
56
56
  16329600:+01:0:3600
57
57
  3024000:+00:1:0
58
58
  27216000:+01:0:3600
59
- 3024000:+00:1:0
60
- 27820800:+01:0:3600
59
+ 3628800:+00:1:0
60
+ 27216000:+01:0:3600
61
61
  3024000:+00:1:0
62
62
  27216000:+01:0:3600
63
63
  3628800:+00:1:0
64
64
  27216000:+01:0:3600
65
- 3024000:+00:1:0
66
- 27820800:+01:0:3600
65
+ 3628800:+00:1:0
66
+ 27216000:+01:0:3600
67
67
  3024000:+00:1:0
68
68
  27216000:+01:0:3600
69
69
  3628800:+00:1:0
@@ -72,14 +72,14 @@
72
72
  27820800:+01:0:3600
73
73
  3024000:+00:1:0
74
74
  27216000:+01:0:3600
75
- 3024000:+00:1:0
76
- 27820800:+01:0:3600
75
+ 3628800:+00:1:0
76
+ 27216000:+01:0:3600
77
77
  3024000:+00:1:0
78
78
  27216000:+01:0:3600
79
79
  3628800:+00:1:0
80
80
  27216000:+01:0:3600
81
- 3024000:+00:1:0
82
- 27820800:+01:0:3600
81
+ 3628800:+00:1:0
82
+ 27216000:+01:0:3600
83
83
  3024000:+00:1:0
84
84
  27216000:+01:0:3600
85
85
  3628800:+00:1:0
@@ -88,11 +88,11 @@
88
88
  27216000:+01:0:3600
89
89
  3628800:+00:1:0
90
90
  27216000:+01:0:3600
91
- 3024000:+00:1:0
92
- 27820800:+01:0:3600
91
+ 3628800:+00:1:0
92
+ 27216000:+01:0:3600
93
93
  3024000:+00:1:0
94
94
  27216000:+01:0:3600
95
95
  3628800:+00:1:0
96
96
  27216000:+01:0:3600
97
- 3024000:+00:1:0
97
+ 3628800:+00:1:0
98
98
  1:+01:0:3600
@@ -1,5 +1,6 @@
1
- -1309746437:LMT:0:8836
2
- 47431636:EAT:0:10800
3
- 315534600:+0230:0:9000
4
- 631151100:+0245:0:9900
1
+ -1946168837:LMT:0:8836
2
+ 636422236:+0230:0:9000
3
+ 47777400:EAT:0:10800
4
+ 220581000:+0230:0:9000
5
+ 176082300:+0245:0:9900
5
6
  1:EAT:0:10800
@@ -1,5 +1,6 @@
1
- -1309746437:LMT:0:8836
2
- 47431636:EAT:0:10800
3
- 315534600:+0230:0:9000
4
- 631151100:+0245:0:9900
1
+ -1946168837:LMT:0:8836
2
+ 636422236:+0230:0:9000
3
+ 47777400:EAT:0:10800
4
+ 220581000:+0230:0:9000
5
+ 176082300:+0245:0:9900
5
6
  1:EAT:0:10800
@@ -1,2 +1,5 @@
1
- -1588464817:LMT:0:816
1
+ -2035584816:LMT:0:815
2
+ 94695215:GMT:0:0
3
+ 173663185:LMT:0:815
4
+ 178760615:+0030:0:1800
2
5
  1:WAT:0:3600
@@ -45,14 +45,14 @@
45
45
  16329600:+01:0:3600
46
46
  3024000:+00:1:0
47
47
  27216000:+01:0:3600
48
- 3024000:+00:1:0
49
- 27820800:+01:0:3600
48
+ 3628800:+00:1:0
49
+ 27216000:+01:0:3600
50
50
  3024000:+00:1:0
51
51
  27216000:+01:0:3600
52
52
  3628800:+00:1:0
53
53
  27216000:+01:0:3600
54
- 3024000:+00:1:0
55
- 27820800:+01:0:3600
54
+ 3628800:+00:1:0
55
+ 27216000:+01:0:3600
56
56
  3024000:+00:1:0
57
57
  27216000:+01:0:3600
58
58
  3628800:+00:1:0
@@ -61,14 +61,14 @@
61
61
  27820800:+01:0:3600
62
62
  3024000:+00:1:0
63
63
  27216000:+01:0:3600
64
- 3024000:+00:1:0
65
- 27820800:+01:0:3600
64
+ 3628800:+00:1:0
65
+ 27216000:+01:0:3600
66
66
  3024000:+00:1:0
67
67
  27216000:+01:0:3600
68
68
  3628800:+00:1:0
69
69
  27216000:+01:0:3600
70
- 3024000:+00:1:0
71
- 27820800:+01:0:3600
70
+ 3628800:+00:1:0
71
+ 27216000:+01:0:3600
72
72
  3024000:+00:1:0
73
73
  27216000:+01:0:3600
74
74
  3628800:+00:1:0
@@ -77,11 +77,11 @@
77
77
  27216000:+01:0:3600
78
78
  3628800:+00:1:0
79
79
  27216000:+01:0:3600
80
- 3024000:+00:1:0
81
- 27820800:+01:0:3600
80
+ 3628800:+00:1:0
81
+ 27216000:+01:0:3600
82
82
  3024000:+00:1:0
83
83
  27216000:+01:0:3600
84
84
  3628800:+00:1:0
85
85
  27216000:+01:0:3600
86
- 3024000:+00:1:0
86
+ 3628800:+00:1:0
87
87
  1:+01:0:3600
@@ -1,5 +1,6 @@
1
- -1309746437:LMT:0:8836
2
- 47431636:EAT:0:10800
3
- 315534600:+0230:0:9000
4
- 631151100:+0245:0:9900
1
+ -1946168837:LMT:0:8836
2
+ 636422236:+0230:0:9000
3
+ 47777400:EAT:0:10800
4
+ 220581000:+0230:0:9000
5
+ 176082300:+0245:0:9900
5
6
  1:EAT:0:10800