tzinfo 0.0.4 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of tzinfo might be problematic. Click here for more details.

Files changed (427) hide show
  1. data/CHANGES +94 -58
  2. data/LICENSE +19 -0
  3. data/README +1 -1
  4. data/Rakefile +75 -0
  5. data/lib/tzinfo.rb +14 -14
  6. data/lib/tzinfo/country.rb +38 -6
  7. data/lib/tzinfo/definitions/Africa/Abidjan.rb +2 -2
  8. data/lib/tzinfo/definitions/Africa/Accra.rb +16 -16
  9. data/lib/tzinfo/definitions/Africa/Addis_Ababa.rb +3 -3
  10. data/lib/tzinfo/definitions/Africa/Algiers.rb +35 -35
  11. data/lib/tzinfo/definitions/Africa/Asmera.rb +4 -4
  12. data/lib/tzinfo/definitions/Africa/Bamako.rb +4 -4
  13. data/lib/tzinfo/definitions/Africa/Bangui.rb +2 -2
  14. data/lib/tzinfo/definitions/Africa/Banjul.rb +4 -4
  15. data/lib/tzinfo/definitions/Africa/Bissau.rb +3 -3
  16. data/lib/tzinfo/definitions/Africa/Blantyre.rb +2 -2
  17. data/lib/tzinfo/definitions/Africa/Brazzaville.rb +2 -2
  18. data/lib/tzinfo/definitions/Africa/Bujumbura.rb +2 -2
  19. data/lib/tzinfo/definitions/Africa/Cairo.rb +192 -191
  20. data/lib/tzinfo/definitions/Africa/Casablanca.rb +20 -20
  21. data/lib/tzinfo/definitions/Africa/Ceuta.rb +146 -145
  22. data/lib/tzinfo/definitions/Africa/Conakry.rb +4 -4
  23. data/lib/tzinfo/definitions/Africa/Dakar.rb +3 -3
  24. data/lib/tzinfo/definitions/Africa/Dar_es_Salaam.rb +4 -4
  25. data/lib/tzinfo/definitions/Africa/Djibouti.rb +2 -2
  26. data/lib/tzinfo/definitions/Africa/Douala.rb +2 -2
  27. data/lib/tzinfo/definitions/Africa/El_Aaiun.rb +3 -3
  28. data/lib/tzinfo/definitions/Africa/Freetown.rb +32 -32
  29. data/lib/tzinfo/definitions/Africa/Gaborone.rb +4 -4
  30. data/lib/tzinfo/definitions/Africa/Harare.rb +2 -2
  31. data/lib/tzinfo/definitions/Africa/Johannesburg.rb +7 -7
  32. data/lib/tzinfo/definitions/Africa/Kampala.rb +5 -5
  33. data/lib/tzinfo/definitions/Africa/Khartoum.rb +35 -35
  34. data/lib/tzinfo/definitions/Africa/Kigali.rb +2 -2
  35. data/lib/tzinfo/definitions/Africa/Kinshasa.rb +2 -2
  36. data/lib/tzinfo/definitions/Africa/Lagos.rb +2 -2
  37. data/lib/tzinfo/definitions/Africa/Libreville.rb +2 -2
  38. data/lib/tzinfo/definitions/Africa/Lome.rb +2 -2
  39. data/lib/tzinfo/definitions/Africa/Luanda.rb +3 -3
  40. data/lib/tzinfo/definitions/Africa/Lubumbashi.rb +2 -2
  41. data/lib/tzinfo/definitions/Africa/Lusaka.rb +2 -2
  42. data/lib/tzinfo/definitions/Africa/Malabo.rb +3 -3
  43. data/lib/tzinfo/definitions/Africa/Maputo.rb +2 -2
  44. data/lib/tzinfo/definitions/Africa/Maseru.rb +4 -4
  45. data/lib/tzinfo/definitions/Africa/Mbabane.rb +2 -2
  46. data/lib/tzinfo/definitions/Africa/Mogadishu.rb +4 -4
  47. data/lib/tzinfo/definitions/Africa/Monrovia.rb +4 -4
  48. data/lib/tzinfo/definitions/Africa/Nairobi.rb +5 -5
  49. data/lib/tzinfo/definitions/Africa/Ndjamena.rb +4 -4
  50. data/lib/tzinfo/definitions/Africa/Niamey.rb +4 -4
  51. data/lib/tzinfo/definitions/Africa/Nouakchott.rb +4 -4
  52. data/lib/tzinfo/definitions/Africa/Ouagadougou.rb +2 -2
  53. data/lib/tzinfo/definitions/Africa/Porto__m__Novo.rb +3 -3
  54. data/lib/tzinfo/definitions/Africa/Sao_Tome.rb +3 -3
  55. data/lib/tzinfo/definitions/Africa/Tripoli.rb +30 -30
  56. data/lib/tzinfo/definitions/Africa/Tunis.rb +29 -29
  57. data/lib/tzinfo/definitions/Africa/Windhoek.rb +110 -110
  58. data/lib/tzinfo/definitions/America/Adak.rb +164 -163
  59. data/lib/tzinfo/definitions/America/Anchorage.rb +164 -163
  60. data/lib/tzinfo/definitions/America/Anguilla.rb +2 -2
  61. data/lib/tzinfo/definitions/America/Antigua.rb +3 -3
  62. data/lib/tzinfo/definitions/America/Araguaina.rb +53 -53
  63. data/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +58 -58
  64. data/lib/tzinfo/definitions/America/Argentina/Catamarca.rb +60 -60
  65. data/lib/tzinfo/definitions/America/Argentina/Cordoba.rb +58 -58
  66. data/lib/tzinfo/definitions/America/Argentina/Jujuy.rb +59 -59
  67. data/lib/tzinfo/definitions/America/Argentina/La_Rioja.rb +61 -61
  68. data/lib/tzinfo/definitions/America/Argentina/Mendoza.rb +60 -60
  69. data/lib/tzinfo/definitions/America/Argentina/Rio_Gallegos.rb +60 -60
  70. data/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +61 -61
  71. data/lib/tzinfo/definitions/America/Argentina/Tucuman.rb +60 -60
  72. data/lib/tzinfo/definitions/America/Argentina/Ushuaia.rb +60 -60
  73. data/lib/tzinfo/definitions/America/Aruba.rb +3 -3
  74. data/lib/tzinfo/definitions/America/Asuncion.rb +146 -145
  75. data/lib/tzinfo/definitions/America/Bahia.rb +61 -61
  76. data/lib/tzinfo/definitions/America/Barbados.rb +11 -11
  77. data/lib/tzinfo/definitions/America/Belem.rb +31 -31
  78. data/lib/tzinfo/definitions/America/Belize.rb +56 -56
  79. data/lib/tzinfo/definitions/America/Boa_Vista.rb +36 -36
  80. data/lib/tzinfo/definitions/America/Bogota.rb +5 -5
  81. data/lib/tzinfo/definitions/America/Boise.rb +167 -166
  82. data/lib/tzinfo/definitions/America/Cambridge_Bay.rb +143 -142
  83. data/lib/tzinfo/definitions/America/Campo_Grande.rb +145 -144
  84. data/lib/tzinfo/definitions/America/Cancun.rb +104 -103
  85. data/lib/tzinfo/definitions/America/Caracas.rb +4 -4
  86. data/lib/tzinfo/definitions/America/Cayenne.rb +3 -3
  87. data/lib/tzinfo/definitions/America/Cayman.rb +3 -3
  88. data/lib/tzinfo/definitions/America/Chicago.rb +256 -255
  89. data/lib/tzinfo/definitions/America/Chihuahua.rb +109 -108
  90. data/lib/tzinfo/definitions/America/Coral_Harbour.rb +9 -9
  91. data/lib/tzinfo/definitions/America/Costa_Rica.rb +11 -11
  92. data/lib/tzinfo/definitions/America/Cuiaba.rb +145 -144
  93. data/lib/tzinfo/definitions/America/Curacao.rb +3 -3
  94. data/lib/tzinfo/definitions/America/Danmarkshavn.rb +35 -35
  95. data/lib/tzinfo/definitions/America/Dawson.rb +143 -142
  96. data/lib/tzinfo/definitions/America/Dawson_Creek.rb +59 -59
  97. data/lib/tzinfo/definitions/America/Denver.rb +178 -177
  98. data/lib/tzinfo/definitions/America/Detroit.rb +158 -157
  99. data/lib/tzinfo/definitions/America/Dominica.rb +2 -2
  100. data/lib/tzinfo/definitions/America/Edmonton.rb +170 -169
  101. data/lib/tzinfo/definitions/America/Eirunepe.rb +35 -35
  102. data/lib/tzinfo/definitions/America/El_Salvador.rb +6 -6
  103. data/lib/tzinfo/definitions/America/Fortaleza.rb +44 -44
  104. data/lib/tzinfo/definitions/America/Glace_Bay.rb +160 -159
  105. data/lib/tzinfo/definitions/America/Godthab.rb +134 -133
  106. data/lib/tzinfo/definitions/America/Goose_Bay.rb +225 -224
  107. data/lib/tzinfo/definitions/America/Grand_Turk.rb +137 -136
  108. data/lib/tzinfo/definitions/America/Grenada.rb +2 -2
  109. data/lib/tzinfo/definitions/America/Guadeloupe.rb +2 -2
  110. data/lib/tzinfo/definitions/America/Guatemala.rb +8 -8
  111. data/lib/tzinfo/definitions/America/Guayaquil.rb +3 -3
  112. data/lib/tzinfo/definitions/America/Guyana.rb +5 -5
  113. data/lib/tzinfo/definitions/America/Halifax.rb +248 -247
  114. data/lib/tzinfo/definitions/America/Havana.rb +175 -174
  115. data/lib/tzinfo/definitions/America/Hermosillo.rb +17 -17
  116. data/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +121 -120
  117. data/lib/tzinfo/definitions/America/Indiana/Knox.rb +172 -171
  118. data/lib/tzinfo/definitions/America/Indiana/Marengo.rb +123 -122
  119. data/lib/tzinfo/definitions/America/Indiana/Vevay.rb +100 -99
  120. data/lib/tzinfo/definitions/America/Inuvik.rb +143 -142
  121. data/lib/tzinfo/definitions/America/Iqaluit.rb +142 -141
  122. data/lib/tzinfo/definitions/America/Jamaica.rb +23 -23
  123. data/lib/tzinfo/definitions/America/Juneau.rb +163 -162
  124. data/lib/tzinfo/definitions/America/Kentucky/Louisville.rb +198 -197
  125. data/lib/tzinfo/definitions/America/Kentucky/Monticello.rb +166 -165
  126. data/lib/tzinfo/definitions/America/La_Paz.rb +4 -4
  127. data/lib/tzinfo/definitions/America/Lima.rb +17 -17
  128. data/lib/tzinfo/definitions/America/Los_Angeles.rb +204 -203
  129. data/lib/tzinfo/definitions/America/Maceio.rb +48 -48
  130. data/lib/tzinfo/definitions/America/Managua.rb +15 -15
  131. data/lib/tzinfo/definitions/America/Manaus.rb +35 -35
  132. data/lib/tzinfo/definitions/America/Martinique.rb +5 -5
  133. data/lib/tzinfo/definitions/America/Mazatlan.rb +110 -109
  134. data/lib/tzinfo/definitions/America/Menominee.rb +160 -159
  135. data/lib/tzinfo/definitions/America/Merida.rb +104 -103
  136. data/lib/tzinfo/definitions/America/Mexico_City.rb +116 -115
  137. data/lib/tzinfo/definitions/America/Miquelon.rb +122 -121
  138. data/lib/tzinfo/definitions/America/Monterrey.rb +106 -105
  139. data/lib/tzinfo/definitions/America/Montevideo.rb +69 -67
  140. data/lib/tzinfo/definitions/America/Montreal.rb +253 -252
  141. data/lib/tzinfo/definitions/America/Montserrat.rb +2 -2
  142. data/lib/tzinfo/definitions/America/Nassau.rb +166 -165
  143. data/lib/tzinfo/definitions/America/New_York.rb +256 -255
  144. data/lib/tzinfo/definitions/America/Nipigon.rb +151 -150
  145. data/lib/tzinfo/definitions/America/Nome.rb +164 -163
  146. data/lib/tzinfo/definitions/America/Noronha.rb +44 -44
  147. data/lib/tzinfo/definitions/America/North_Dakota/Center.rb +166 -165
  148. data/lib/tzinfo/definitions/America/Panama.rb +3 -3
  149. data/lib/tzinfo/definitions/America/Pangnirtung.rb +142 -141
  150. data/lib/tzinfo/definitions/America/Paramaribo.rb +6 -6
  151. data/lib/tzinfo/definitions/America/Phoenix.rb +14 -14
  152. data/lib/tzinfo/definitions/America/Port__m__au__m__Prince.rb +35 -35
  153. data/lib/tzinfo/definitions/America/Port_of_Spain.rb +2 -2
  154. data/lib/tzinfo/definitions/America/Porto_Velho.rb +31 -31
  155. data/lib/tzinfo/definitions/America/Puerto_Rico.rb +4 -4
  156. data/lib/tzinfo/definitions/America/Rainy_River.rb +151 -150
  157. data/lib/tzinfo/definitions/America/Rankin_Inlet.rb +142 -141
  158. data/lib/tzinfo/definitions/America/Recife.rb +44 -44
  159. data/lib/tzinfo/definitions/America/Regina.rb +53 -53
  160. data/lib/tzinfo/definitions/America/Rio_Branco.rb +31 -31
  161. data/lib/tzinfo/definitions/America/Santiago.rb +175 -174
  162. data/lib/tzinfo/definitions/America/Santo_Domingo.rb +18 -18
  163. data/lib/tzinfo/definitions/America/Sao_Paulo.rb +146 -145
  164. data/lib/tzinfo/definitions/America/Scoresbysund.rb +134 -133
  165. data/lib/tzinfo/definitions/America/St_Johns.rb +259 -258
  166. data/lib/tzinfo/definitions/America/St_Kitts.rb +2 -2
  167. data/lib/tzinfo/definitions/America/St_Lucia.rb +3 -3
  168. data/lib/tzinfo/definitions/America/St_Thomas.rb +2 -2
  169. data/lib/tzinfo/definitions/America/St_Vincent.rb +3 -3
  170. data/lib/tzinfo/definitions/America/Swift_Current.rb +23 -23
  171. data/lib/tzinfo/definitions/America/Tegucigalpa.rb +6 -6
  172. data/lib/tzinfo/definitions/America/Thule.rb +112 -111
  173. data/lib/tzinfo/definitions/America/Thunder_Bay.rb +159 -158
  174. data/lib/tzinfo/definitions/America/Tijuana.rb +171 -170
  175. data/lib/tzinfo/definitions/America/Toronto.rb +252 -251
  176. data/lib/tzinfo/definitions/America/Tortola.rb +2 -2
  177. data/lib/tzinfo/definitions/America/Vancouver.rb +206 -205
  178. data/lib/tzinfo/definitions/America/Whitehorse.rb +143 -142
  179. data/lib/tzinfo/definitions/America/Winnipeg.rb +202 -201
  180. data/lib/tzinfo/definitions/America/Yakutat.rb +163 -162
  181. data/lib/tzinfo/definitions/America/Yellowknife.rb +142 -141
  182. data/lib/tzinfo/definitions/Antarctica/Casey.rb +2 -2
  183. data/lib/tzinfo/definitions/Antarctica/Davis.rb +4 -4
  184. data/lib/tzinfo/definitions/Antarctica/DumontDUrville.rb +4 -4
  185. data/lib/tzinfo/definitions/Antarctica/Mawson.rb +2 -2
  186. data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +145 -144
  187. data/lib/tzinfo/definitions/Antarctica/Palmer.rb +147 -146
  188. data/lib/tzinfo/definitions/Antarctica/Rothera.rb +2 -2
  189. data/lib/tzinfo/definitions/Antarctica/Syowa.rb +2 -2
  190. data/lib/tzinfo/definitions/Antarctica/Vostok.rb +2 -2
  191. data/lib/tzinfo/definitions/Asia/Aden.rb +2 -2
  192. data/lib/tzinfo/definitions/Asia/Almaty.rb +52 -52
  193. data/lib/tzinfo/definitions/Asia/Amman.rb +136 -135
  194. data/lib/tzinfo/definitions/Asia/Anadyr.rb +134 -133
  195. data/lib/tzinfo/definitions/Asia/Aqtau.rb +52 -52
  196. data/lib/tzinfo/definitions/Asia/Aqtobe.rb +52 -52
  197. data/lib/tzinfo/definitions/Asia/Ashgabat.rb +27 -27
  198. data/lib/tzinfo/definitions/Asia/Baghdad.rb +131 -130
  199. data/lib/tzinfo/definitions/Asia/Bahrain.rb +3 -3
  200. data/lib/tzinfo/definitions/Asia/Baku.rb +130 -129
  201. data/lib/tzinfo/definitions/Asia/Bangkok.rb +3 -3
  202. data/lib/tzinfo/definitions/Asia/Beirut.rb +158 -157
  203. data/lib/tzinfo/definitions/Asia/Bishkek.rb +52 -131
  204. data/lib/tzinfo/definitions/Asia/Brunei.rb +3 -3
  205. data/lib/tzinfo/definitions/Asia/Calcutta.rb +6 -6
  206. data/lib/tzinfo/definitions/Asia/Choibalsan.rb +125 -124
  207. data/lib/tzinfo/definitions/Asia/Chongqing.rb +15 -15
  208. data/lib/tzinfo/definitions/Asia/Colombo.rb +8 -8
  209. data/lib/tzinfo/definitions/Asia/Damascus.rb +168 -167
  210. data/lib/tzinfo/definitions/Asia/Dhaka.rb +7 -7
  211. data/lib/tzinfo/definitions/Asia/Dili.rb +6 -6
  212. data/lib/tzinfo/definitions/Asia/Dubai.rb +2 -2
  213. data/lib/tzinfo/definitions/Asia/Dushanbe.rb +25 -25
  214. data/lib/tzinfo/definitions/Asia/Gaza.rb +162 -161
  215. data/lib/tzinfo/definitions/Asia/Harbin.rb +18 -18
  216. data/lib/tzinfo/definitions/Asia/Hong_Kong.rb +70 -70
  217. data/lib/tzinfo/definitions/Asia/Hovd.rb +125 -124
  218. data/lib/tzinfo/definitions/Asia/Irkutsk.rb +135 -134
  219. data/lib/tzinfo/definitions/Asia/Jakarta.rb +9 -9
  220. data/lib/tzinfo/definitions/Asia/Jayapura.rb +4 -4
  221. data/lib/tzinfo/definitions/Asia/Jerusalem.rb +144 -144
  222. data/lib/tzinfo/definitions/Asia/Kabul.rb +3 -3
  223. data/lib/tzinfo/definitions/Asia/Kamchatka.rb +134 -133
  224. data/lib/tzinfo/definitions/Asia/Karachi.rb +8 -8
  225. data/lib/tzinfo/definitions/Asia/Kashgar.rb +16 -16
  226. data/lib/tzinfo/definitions/Asia/Katmandu.rb +3 -3
  227. data/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +134 -133
  228. data/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +9 -9
  229. data/lib/tzinfo/definitions/Asia/Kuching.rb +20 -20
  230. data/lib/tzinfo/definitions/Asia/Kuwait.rb +2 -2
  231. data/lib/tzinfo/definitions/Asia/Macau.rb +43 -43
  232. data/lib/tzinfo/definitions/Asia/Magadan.rb +134 -133
  233. data/lib/tzinfo/definitions/Asia/Makassar.rb +5 -5
  234. data/lib/tzinfo/definitions/Asia/Manila.rb +11 -11
  235. data/lib/tzinfo/definitions/Asia/Muscat.rb +2 -2
  236. data/lib/tzinfo/definitions/Asia/Nicosia.rb +145 -144
  237. data/lib/tzinfo/definitions/Asia/Novosibirsk.rb +135 -134
  238. data/lib/tzinfo/definitions/Asia/Omsk.rb +134 -133
  239. data/lib/tzinfo/definitions/Asia/Oral.rb +52 -52
  240. data/lib/tzinfo/definitions/Asia/Phnom_Penh.rb +5 -5
  241. data/lib/tzinfo/definitions/Asia/Pontianak.rb +9 -9
  242. data/lib/tzinfo/definitions/Asia/Pyongyang.rb +7 -7
  243. data/lib/tzinfo/definitions/Asia/Qatar.rb +3 -3
  244. data/lib/tzinfo/definitions/Asia/Qyzylorda.rb +53 -53
  245. data/lib/tzinfo/definitions/Asia/Rangoon.rb +5 -5
  246. data/lib/tzinfo/definitions/Asia/Riyadh.rb +2 -2
  247. data/lib/tzinfo/definitions/Asia/Saigon.rb +5 -5
  248. data/lib/tzinfo/definitions/Asia/Sakhalin.rb +135 -134
  249. data/lib/tzinfo/definitions/Asia/Samarkand.rb +30 -30
  250. data/lib/tzinfo/definitions/Asia/Seoul.rb +14 -14
  251. data/lib/tzinfo/definitions/Asia/Shanghai.rb +19 -19
  252. data/lib/tzinfo/definitions/Asia/Singapore.rb +10 -10
  253. data/lib/tzinfo/definitions/Asia/Taipei.rb +42 -42
  254. data/lib/tzinfo/definitions/Asia/Tashkent.rb +30 -30
  255. data/lib/tzinfo/definitions/Asia/Tbilisi.rb +137 -136
  256. data/lib/tzinfo/definitions/Asia/Tehran.rb +105 -105
  257. data/lib/tzinfo/definitions/Asia/Thimphu.rb +3 -3
  258. data/lib/tzinfo/definitions/Asia/Tokyo.rb +12 -12
  259. data/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +125 -124
  260. data/lib/tzinfo/definitions/Asia/Urumqi.rb +15 -15
  261. data/lib/tzinfo/definitions/Asia/Vientiane.rb +5 -5
  262. data/lib/tzinfo/definitions/Asia/Vladivostok.rb +134 -133
  263. data/lib/tzinfo/definitions/Asia/Yakutsk.rb +134 -133
  264. data/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +134 -133
  265. data/lib/tzinfo/definitions/Asia/Yerevan.rb +133 -132
  266. data/lib/tzinfo/definitions/Atlantic/Azores.rb +238 -237
  267. data/lib/tzinfo/definitions/Atlantic/Bermuda.rb +146 -145
  268. data/lib/tzinfo/definitions/Atlantic/Canary.rb +136 -135
  269. data/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +5 -5
  270. data/lib/tzinfo/definitions/Atlantic/Faeroe.rb +133 -132
  271. data/lib/tzinfo/definitions/Atlantic/Madeira.rb +238 -237
  272. data/lib/tzinfo/definitions/Atlantic/Reykjavik.rb +66 -66
  273. data/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +2 -2
  274. data/lib/tzinfo/definitions/Atlantic/St_Helena.rb +3 -3
  275. data/lib/tzinfo/definitions/Atlantic/Stanley.rb +141 -141
  276. data/lib/tzinfo/definitions/Australia/Adelaide.rb +161 -160
  277. data/lib/tzinfo/definitions/Australia/Brisbane.rb +19 -19
  278. data/lib/tzinfo/definitions/Australia/Broken_Hill.rb +163 -162
  279. data/lib/tzinfo/definitions/Australia/Currie.rb +161 -160
  280. data/lib/tzinfo/definitions/Australia/Darwin.rb +11 -11
  281. data/lib/tzinfo/definitions/Australia/Hobart.rb +169 -168
  282. data/lib/tzinfo/definitions/Australia/Lindeman.rb +24 -24
  283. data/lib/tzinfo/definitions/Australia/Lord_Howe.rb +132 -131
  284. data/lib/tzinfo/definitions/Australia/Melbourne.rb +160 -159
  285. data/lib/tzinfo/definitions/Australia/Perth.rb +15 -15
  286. data/lib/tzinfo/definitions/Australia/Sydney.rb +160 -159
  287. data/lib/tzinfo/definitions/CET.rb +151 -150
  288. data/lib/tzinfo/definitions/EET.rb +139 -138
  289. data/lib/tzinfo/definitions/Etc/GMT.rb +1 -1
  290. data/lib/tzinfo/definitions/Etc/GMT__m__1.rb +1 -1
  291. data/lib/tzinfo/definitions/Etc/GMT__m__10.rb +1 -1
  292. data/lib/tzinfo/definitions/Etc/GMT__m__11.rb +1 -1
  293. data/lib/tzinfo/definitions/Etc/GMT__m__12.rb +1 -1
  294. data/lib/tzinfo/definitions/Etc/GMT__m__13.rb +1 -1
  295. data/lib/tzinfo/definitions/Etc/GMT__m__14.rb +1 -1
  296. data/lib/tzinfo/definitions/Etc/GMT__m__2.rb +1 -1
  297. data/lib/tzinfo/definitions/Etc/GMT__m__3.rb +1 -1
  298. data/lib/tzinfo/definitions/Etc/GMT__m__4.rb +1 -1
  299. data/lib/tzinfo/definitions/Etc/GMT__m__5.rb +1 -1
  300. data/lib/tzinfo/definitions/Etc/GMT__m__6.rb +1 -1
  301. data/lib/tzinfo/definitions/Etc/GMT__m__7.rb +1 -1
  302. data/lib/tzinfo/definitions/Etc/GMT__m__8.rb +1 -1
  303. data/lib/tzinfo/definitions/Etc/GMT__m__9.rb +1 -1
  304. data/lib/tzinfo/definitions/Etc/GMT__p__1.rb +1 -1
  305. data/lib/tzinfo/definitions/Etc/GMT__p__10.rb +1 -1
  306. data/lib/tzinfo/definitions/Etc/GMT__p__11.rb +1 -1
  307. data/lib/tzinfo/definitions/Etc/GMT__p__12.rb +1 -1
  308. data/lib/tzinfo/definitions/Etc/GMT__p__2.rb +1 -1
  309. data/lib/tzinfo/definitions/Etc/GMT__p__3.rb +1 -1
  310. data/lib/tzinfo/definitions/Etc/GMT__p__4.rb +1 -1
  311. data/lib/tzinfo/definitions/Etc/GMT__p__5.rb +1 -1
  312. data/lib/tzinfo/definitions/Etc/GMT__p__6.rb +1 -1
  313. data/lib/tzinfo/definitions/Etc/GMT__p__7.rb +1 -1
  314. data/lib/tzinfo/definitions/Etc/GMT__p__8.rb +1 -1
  315. data/lib/tzinfo/definitions/Etc/GMT__p__9.rb +1 -1
  316. data/lib/tzinfo/definitions/Etc/UCT.rb +1 -1
  317. data/lib/tzinfo/definitions/Etc/UTC.rb +1 -1
  318. data/lib/tzinfo/definitions/Europe/Amsterdam.rb +197 -196
  319. data/lib/tzinfo/definitions/Europe/Andorra.rb +125 -124
  320. data/lib/tzinfo/definitions/Europe/Athens.rb +156 -155
  321. data/lib/tzinfo/definitions/Europe/Belgrade.rb +136 -135
  322. data/lib/tzinfo/definitions/Europe/Berlin.rb +161 -160
  323. data/lib/tzinfo/definitions/Europe/Brussels.rb +203 -202
  324. data/lib/tzinfo/definitions/Europe/Bucharest.rb +156 -155
  325. data/lib/tzinfo/definitions/Europe/Budapest.rb +170 -169
  326. data/lib/tzinfo/definitions/Europe/Chisinau.rb +159 -158
  327. data/lib/tzinfo/definitions/Europe/Copenhagen.rb +152 -151
  328. data/lib/tzinfo/definitions/Europe/Dublin.rb +246 -245
  329. data/lib/tzinfo/definitions/Europe/Gibraltar.rb +216 -215
  330. data/lib/tzinfo/definitions/Europe/Helsinki.rb +136 -135
  331. data/lib/tzinfo/definitions/Europe/Istanbul.rb +190 -189
  332. data/lib/tzinfo/definitions/Europe/Kaliningrad.rb +148 -147
  333. data/lib/tzinfo/definitions/Europe/Kiev.rb +138 -137
  334. data/lib/tzinfo/definitions/Europe/Lisbon.rb +239 -238
  335. data/lib/tzinfo/definitions/Europe/London.rb +260 -259
  336. data/lib/tzinfo/definitions/Europe/Luxembourg.rb +200 -199
  337. data/lib/tzinfo/definitions/Europe/Madrid.rb +182 -181
  338. data/lib/tzinfo/definitions/Europe/Malta.rb +187 -186
  339. data/lib/tzinfo/definitions/Europe/Minsk.rb +136 -135
  340. data/lib/tzinfo/definitions/Europe/Monaco.rb +203 -202
  341. data/lib/tzinfo/definitions/Europe/Moscow.rb +147 -146
  342. data/lib/tzinfo/definitions/Europe/Oslo.rb +158 -157
  343. data/lib/tzinfo/definitions/Europe/Paris.rb +201 -200
  344. data/lib/tzinfo/definitions/Europe/Prague.rb +159 -158
  345. data/lib/tzinfo/definitions/Europe/Riga.rb +145 -144
  346. data/lib/tzinfo/definitions/Europe/Rome.rb +189 -188
  347. data/lib/tzinfo/definitions/Europe/Samara.rb +134 -133
  348. data/lib/tzinfo/definitions/Europe/Simferopol.rb +140 -139
  349. data/lib/tzinfo/definitions/Europe/Sofia.rb +146 -145
  350. data/lib/tzinfo/definitions/Europe/Stockholm.rb +138 -137
  351. data/lib/tzinfo/definitions/Europe/Tallinn.rb +141 -140
  352. data/lib/tzinfo/definitions/Europe/Tirane.rb +151 -150
  353. data/lib/tzinfo/definitions/Europe/Uzhgorod.rb +142 -141
  354. data/lib/tzinfo/definitions/Europe/Vaduz.rb +133 -132
  355. data/lib/tzinfo/definitions/Europe/Vienna.rb +159 -158
  356. data/lib/tzinfo/definitions/Europe/Vilnius.rb +137 -136
  357. data/lib/tzinfo/definitions/Europe/Warsaw.rb +184 -183
  358. data/lib/tzinfo/definitions/Europe/Zaporozhye.rb +139 -138
  359. data/lib/tzinfo/definitions/Europe/Zurich.rb +140 -139
  360. data/lib/tzinfo/definitions/Indian/Antananarivo.rb +4 -4
  361. data/lib/tzinfo/definitions/Indian/Chagos.rb +3 -3
  362. data/lib/tzinfo/definitions/Indian/Christmas.rb +2 -2
  363. data/lib/tzinfo/definitions/Indian/Cocos.rb +2 -2
  364. data/lib/tzinfo/definitions/Indian/Comoro.rb +2 -2
  365. data/lib/tzinfo/definitions/Indian/Kerguelen.rb +2 -2
  366. data/lib/tzinfo/definitions/Indian/Mahe.rb +2 -2
  367. data/lib/tzinfo/definitions/Indian/Maldives.rb +3 -3
  368. data/lib/tzinfo/definitions/Indian/Mauritius.rb +2 -2
  369. data/lib/tzinfo/definitions/Indian/Mayotte.rb +2 -2
  370. data/lib/tzinfo/definitions/Indian/Reunion.rb +2 -2
  371. data/lib/tzinfo/definitions/MET.rb +151 -150
  372. data/lib/tzinfo/definitions/Pacific/Apia.rb +4 -4
  373. data/lib/tzinfo/definitions/Pacific/Auckland.rb +173 -172
  374. data/lib/tzinfo/definitions/Pacific/Chatham.rb +145 -144
  375. data/lib/tzinfo/definitions/Pacific/Easter.rb +163 -162
  376. data/lib/tzinfo/definitions/Pacific/Efate.rb +22 -22
  377. data/lib/tzinfo/definitions/Pacific/Enderbury.rb +4 -4
  378. data/lib/tzinfo/definitions/Pacific/Fakaofo.rb +2 -2
  379. data/lib/tzinfo/definitions/Pacific/Fiji.rb +6 -6
  380. data/lib/tzinfo/definitions/Pacific/Funafuti.rb +2 -2
  381. data/lib/tzinfo/definitions/Pacific/Galapagos.rb +3 -3
  382. data/lib/tzinfo/definitions/Pacific/Gambier.rb +2 -2
  383. data/lib/tzinfo/definitions/Pacific/Guadalcanal.rb +2 -2
  384. data/lib/tzinfo/definitions/Pacific/Guam.rb +4 -4
  385. data/lib/tzinfo/definitions/Pacific/Honolulu.rb +6 -6
  386. data/lib/tzinfo/definitions/Pacific/Johnston.rb +1 -1
  387. data/lib/tzinfo/definitions/Pacific/Kiritimati.rb +4 -4
  388. data/lib/tzinfo/definitions/Pacific/Kosrae.rb +4 -4
  389. data/lib/tzinfo/definitions/Pacific/Kwajalein.rb +4 -4
  390. data/lib/tzinfo/definitions/Pacific/Majuro.rb +3 -3
  391. data/lib/tzinfo/definitions/Pacific/Marquesas.rb +2 -2
  392. data/lib/tzinfo/definitions/Pacific/Midway.rb +6 -6
  393. data/lib/tzinfo/definitions/Pacific/Nauru.rb +5 -5
  394. data/lib/tzinfo/definitions/Pacific/Niue.rb +4 -4
  395. data/lib/tzinfo/definitions/Pacific/Norfolk.rb +3 -3
  396. data/lib/tzinfo/definitions/Pacific/Noumea.rb +8 -8
  397. data/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +6 -6
  398. data/lib/tzinfo/definitions/Pacific/Palau.rb +2 -2
  399. data/lib/tzinfo/definitions/Pacific/Pitcairn.rb +3 -3
  400. data/lib/tzinfo/definitions/Pacific/Ponape.rb +2 -2
  401. data/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +3 -3
  402. data/lib/tzinfo/definitions/Pacific/Rarotonga.rb +28 -28
  403. data/lib/tzinfo/definitions/Pacific/Saipan.rb +5 -5
  404. data/lib/tzinfo/definitions/Pacific/Tahiti.rb +2 -2
  405. data/lib/tzinfo/definitions/Pacific/Tarawa.rb +2 -2
  406. data/lib/tzinfo/definitions/Pacific/Tongatapu.rb +10 -10
  407. data/lib/tzinfo/definitions/Pacific/Truk.rb +2 -2
  408. data/lib/tzinfo/definitions/Pacific/Wake.rb +2 -2
  409. data/lib/tzinfo/definitions/Pacific/Wallis.rb +2 -2
  410. data/lib/tzinfo/definitions/WET.rb +139 -138
  411. data/lib/tzinfo/timezone.rb +170 -175
  412. data/lib/tzinfo/timezone_period.rb +175 -0
  413. data/lib/tzinfo/timezone_period_list.rb +225 -0
  414. data/lib/tzinfo/tzdataparser.rb +99 -26
  415. data/test/tc_timezone.rb +231 -1
  416. data/test/tc_timezone_london.rb +13 -6
  417. data/test/tc_timezone_melbourne.rb +13 -6
  418. data/test/tc_timezone_new_york.rb +13 -6
  419. data/test/tc_timezone_period.rb +1 -1
  420. data/test/tc_timezone_period_list.rb +288 -0
  421. metadata +14 -12
  422. data/lib/tzinfo/definitions/Asia/Riyadh87.rb +0 -349
  423. data/lib/tzinfo/definitions/Asia/Riyadh88.rb +0 -350
  424. data/lib/tzinfo/definitions/Asia/Riyadh89.rb +0 -350
  425. data/lib/tzinfo/definitions/Mideast/Riyadh87.rb +0 -11
  426. data/lib/tzinfo/definitions/Mideast/Riyadh88.rb +0 -11
  427. data/lib/tzinfo/definitions/Mideast/Riyadh89.rb +0 -11
@@ -5,8 +5,8 @@ module Pacific #:nodoc:
5
5
  class Wake < Timezone #:nodoc:
6
6
  setup
7
7
  set_identifier('Pacific/Wake')
8
- add_period(TimezonePeriod.new(nil,DateTime.new(1900,12,31,12,53,32),39988,0,:'LMT'))
9
- add_period(TimezonePeriod.new(DateTime.new(1900,12,31,12,53,32),nil,43200,0,:'WAKT'))
8
+ add_unbounded_start_period {TimezonePeriod.new(nil,DateTime.new0(Rational.new!(52172316803,21600),0,Date::ITALY),39988,0,:'LMT')}
9
+ add_period(1900,12) {TimezonePeriod.new(DateTime.new0(Rational.new!(52172316803,21600),0,Date::ITALY),nil,43200,0,:'WAKT')}
10
10
  end
11
11
  end
12
12
  end
@@ -5,8 +5,8 @@ module Pacific #:nodoc:
5
5
  class Wallis < Timezone #:nodoc:
6
6
  setup
7
7
  set_identifier('Pacific/Wallis')
8
- add_period(TimezonePeriod.new(nil,DateTime.new(1900,12,31,11,44,40),44120,0,:'LMT'))
9
- add_period(TimezonePeriod.new(DateTime.new(1900,12,31,11,44,40),nil,43200,0,:'WFT'))
8
+ add_unbounded_start_period {TimezonePeriod.new(nil,DateTime.new0(Rational.new!(5217231577,2160),0,Date::ITALY),44120,0,:'LMT')}
9
+ add_period(1900,12) {TimezonePeriod.new(DateTime.new0(Rational.new!(5217231577,2160),0,Date::ITALY),nil,43200,0,:'WFT')}
10
10
  end
11
11
  end
12
12
  end
@@ -4,144 +4,145 @@ module Definitions #:nodoc:
4
4
  class WET < Timezone #:nodoc:
5
5
  setup
6
6
  set_identifier('WET')
7
- add_period(TimezonePeriod.new(DateTime.new(1850,1,1,0,0,0),DateTime.new(1977,4,3,1,0,0),0,0,:'WET'))
8
- add_period(TimezonePeriod.new(DateTime.new(1977,4,3,1,0,0),DateTime.new(1977,9,25,1,0,0),0,3600,:'WEST'))
9
- add_period(TimezonePeriod.new(DateTime.new(1977,9,25,1,0,0),DateTime.new(1978,4,2,1,0,0),0,0,:'WET'))
10
- add_period(TimezonePeriod.new(DateTime.new(1978,4,2,1,0,0),DateTime.new(1978,10,1,1,0,0),0,3600,:'WEST'))
11
- add_period(TimezonePeriod.new(DateTime.new(1978,10,1,1,0,0),DateTime.new(1979,4,1,1,0,0),0,0,:'WET'))
12
- add_period(TimezonePeriod.new(DateTime.new(1979,4,1,1,0,0),DateTime.new(1979,9,30,1,0,0),0,3600,:'WEST'))
13
- add_period(TimezonePeriod.new(DateTime.new(1979,9,30,1,0,0),DateTime.new(1980,4,6,1,0,0),0,0,:'WET'))
14
- add_period(TimezonePeriod.new(DateTime.new(1980,4,6,1,0,0),DateTime.new(1980,9,28,1,0,0),0,3600,:'WEST'))
15
- add_period(TimezonePeriod.new(DateTime.new(1980,9,28,1,0,0),DateTime.new(1981,3,29,1,0,0),0,0,:'WET'))
16
- add_period(TimezonePeriod.new(DateTime.new(1981,3,29,1,0,0),DateTime.new(1981,9,27,1,0,0),0,3600,:'WEST'))
17
- add_period(TimezonePeriod.new(DateTime.new(1981,9,27,1,0,0),DateTime.new(1982,3,28,1,0,0),0,0,:'WET'))
18
- add_period(TimezonePeriod.new(DateTime.new(1982,3,28,1,0,0),DateTime.new(1982,9,26,1,0,0),0,3600,:'WEST'))
19
- add_period(TimezonePeriod.new(DateTime.new(1982,9,26,1,0,0),DateTime.new(1983,3,27,1,0,0),0,0,:'WET'))
20
- add_period(TimezonePeriod.new(DateTime.new(1983,3,27,1,0,0),DateTime.new(1983,9,25,1,0,0),0,3600,:'WEST'))
21
- add_period(TimezonePeriod.new(DateTime.new(1983,9,25,1,0,0),DateTime.new(1984,3,25,1,0,0),0,0,:'WET'))
22
- add_period(TimezonePeriod.new(DateTime.new(1984,3,25,1,0,0),DateTime.new(1984,9,30,1,0,0),0,3600,:'WEST'))
23
- add_period(TimezonePeriod.new(DateTime.new(1984,9,30,1,0,0),DateTime.new(1985,3,31,1,0,0),0,0,:'WET'))
24
- add_period(TimezonePeriod.new(DateTime.new(1985,3,31,1,0,0),DateTime.new(1985,9,29,1,0,0),0,3600,:'WEST'))
25
- add_period(TimezonePeriod.new(DateTime.new(1985,9,29,1,0,0),DateTime.new(1986,3,30,1,0,0),0,0,:'WET'))
26
- add_period(TimezonePeriod.new(DateTime.new(1986,3,30,1,0,0),DateTime.new(1986,9,28,1,0,0),0,3600,:'WEST'))
27
- add_period(TimezonePeriod.new(DateTime.new(1986,9,28,1,0,0),DateTime.new(1987,3,29,1,0,0),0,0,:'WET'))
28
- add_period(TimezonePeriod.new(DateTime.new(1987,3,29,1,0,0),DateTime.new(1987,9,27,1,0,0),0,3600,:'WEST'))
29
- add_period(TimezonePeriod.new(DateTime.new(1987,9,27,1,0,0),DateTime.new(1988,3,27,1,0,0),0,0,:'WET'))
30
- add_period(TimezonePeriod.new(DateTime.new(1988,3,27,1,0,0),DateTime.new(1988,9,25,1,0,0),0,3600,:'WEST'))
31
- add_period(TimezonePeriod.new(DateTime.new(1988,9,25,1,0,0),DateTime.new(1989,3,26,1,0,0),0,0,:'WET'))
32
- add_period(TimezonePeriod.new(DateTime.new(1989,3,26,1,0,0),DateTime.new(1989,9,24,1,0,0),0,3600,:'WEST'))
33
- add_period(TimezonePeriod.new(DateTime.new(1989,9,24,1,0,0),DateTime.new(1990,3,25,1,0,0),0,0,:'WET'))
34
- add_period(TimezonePeriod.new(DateTime.new(1990,3,25,1,0,0),DateTime.new(1990,9,30,1,0,0),0,3600,:'WEST'))
35
- add_period(TimezonePeriod.new(DateTime.new(1990,9,30,1,0,0),DateTime.new(1991,3,31,1,0,0),0,0,:'WET'))
36
- add_period(TimezonePeriod.new(DateTime.new(1991,3,31,1,0,0),DateTime.new(1991,9,29,1,0,0),0,3600,:'WEST'))
37
- add_period(TimezonePeriod.new(DateTime.new(1991,9,29,1,0,0),DateTime.new(1992,3,29,1,0,0),0,0,:'WET'))
38
- add_period(TimezonePeriod.new(DateTime.new(1992,3,29,1,0,0),DateTime.new(1992,9,27,1,0,0),0,3600,:'WEST'))
39
- add_period(TimezonePeriod.new(DateTime.new(1992,9,27,1,0,0),DateTime.new(1993,3,28,1,0,0),0,0,:'WET'))
40
- add_period(TimezonePeriod.new(DateTime.new(1993,3,28,1,0,0),DateTime.new(1993,9,26,1,0,0),0,3600,:'WEST'))
41
- add_period(TimezonePeriod.new(DateTime.new(1993,9,26,1,0,0),DateTime.new(1994,3,27,1,0,0),0,0,:'WET'))
42
- add_period(TimezonePeriod.new(DateTime.new(1994,3,27,1,0,0),DateTime.new(1994,9,25,1,0,0),0,3600,:'WEST'))
43
- add_period(TimezonePeriod.new(DateTime.new(1994,9,25,1,0,0),DateTime.new(1995,3,26,1,0,0),0,0,:'WET'))
44
- add_period(TimezonePeriod.new(DateTime.new(1995,3,26,1,0,0),DateTime.new(1995,9,24,1,0,0),0,3600,:'WEST'))
45
- add_period(TimezonePeriod.new(DateTime.new(1995,9,24,1,0,0),DateTime.new(1996,3,31,1,0,0),0,0,:'WET'))
46
- add_period(TimezonePeriod.new(DateTime.new(1996,3,31,1,0,0),DateTime.new(1996,10,27,1,0,0),0,3600,:'WEST'))
47
- add_period(TimezonePeriod.new(DateTime.new(1996,10,27,1,0,0),DateTime.new(1997,3,30,1,0,0),0,0,:'WET'))
48
- add_period(TimezonePeriod.new(DateTime.new(1997,3,30,1,0,0),DateTime.new(1997,10,26,1,0,0),0,3600,:'WEST'))
49
- add_period(TimezonePeriod.new(DateTime.new(1997,10,26,1,0,0),DateTime.new(1998,3,29,1,0,0),0,0,:'WET'))
50
- add_period(TimezonePeriod.new(DateTime.new(1998,3,29,1,0,0),DateTime.new(1998,10,25,1,0,0),0,3600,:'WEST'))
51
- add_period(TimezonePeriod.new(DateTime.new(1998,10,25,1,0,0),DateTime.new(1999,3,28,1,0,0),0,0,:'WET'))
52
- add_period(TimezonePeriod.new(DateTime.new(1999,3,28,1,0,0),DateTime.new(1999,10,31,1,0,0),0,3600,:'WEST'))
53
- add_period(TimezonePeriod.new(DateTime.new(1999,10,31,1,0,0),DateTime.new(2000,3,26,1,0,0),0,0,:'WET'))
54
- add_period(TimezonePeriod.new(DateTime.new(2000,3,26,1,0,0),DateTime.new(2000,10,29,1,0,0),0,3600,:'WEST'))
55
- add_period(TimezonePeriod.new(DateTime.new(2000,10,29,1,0,0),DateTime.new(2001,3,25,1,0,0),0,0,:'WET'))
56
- add_period(TimezonePeriod.new(DateTime.new(2001,3,25,1,0,0),DateTime.new(2001,10,28,1,0,0),0,3600,:'WEST'))
57
- add_period(TimezonePeriod.new(DateTime.new(2001,10,28,1,0,0),DateTime.new(2002,3,31,1,0,0),0,0,:'WET'))
58
- add_period(TimezonePeriod.new(DateTime.new(2002,3,31,1,0,0),DateTime.new(2002,10,27,1,0,0),0,3600,:'WEST'))
59
- add_period(TimezonePeriod.new(DateTime.new(2002,10,27,1,0,0),DateTime.new(2003,3,30,1,0,0),0,0,:'WET'))
60
- add_period(TimezonePeriod.new(DateTime.new(2003,3,30,1,0,0),DateTime.new(2003,10,26,1,0,0),0,3600,:'WEST'))
61
- add_period(TimezonePeriod.new(DateTime.new(2003,10,26,1,0,0),DateTime.new(2004,3,28,1,0,0),0,0,:'WET'))
62
- add_period(TimezonePeriod.new(DateTime.new(2004,3,28,1,0,0),DateTime.new(2004,10,31,1,0,0),0,3600,:'WEST'))
63
- add_period(TimezonePeriod.new(DateTime.new(2004,10,31,1,0,0),DateTime.new(2005,3,27,1,0,0),0,0,:'WET'))
64
- add_period(TimezonePeriod.new(DateTime.new(2005,3,27,1,0,0),DateTime.new(2005,10,30,1,0,0),0,3600,:'WEST'))
65
- add_period(TimezonePeriod.new(DateTime.new(2005,10,30,1,0,0),DateTime.new(2006,3,26,1,0,0),0,0,:'WET'))
66
- add_period(TimezonePeriod.new(DateTime.new(2006,3,26,1,0,0),DateTime.new(2006,10,29,1,0,0),0,3600,:'WEST'))
67
- add_period(TimezonePeriod.new(DateTime.new(2006,10,29,1,0,0),DateTime.new(2007,3,25,1,0,0),0,0,:'WET'))
68
- add_period(TimezonePeriod.new(DateTime.new(2007,3,25,1,0,0),DateTime.new(2007,10,28,1,0,0),0,3600,:'WEST'))
69
- add_period(TimezonePeriod.new(DateTime.new(2007,10,28,1,0,0),DateTime.new(2008,3,30,1,0,0),0,0,:'WET'))
70
- add_period(TimezonePeriod.new(DateTime.new(2008,3,30,1,0,0),DateTime.new(2008,10,26,1,0,0),0,3600,:'WEST'))
71
- add_period(TimezonePeriod.new(DateTime.new(2008,10,26,1,0,0),DateTime.new(2009,3,29,1,0,0),0,0,:'WET'))
72
- add_period(TimezonePeriod.new(DateTime.new(2009,3,29,1,0,0),DateTime.new(2009,10,25,1,0,0),0,3600,:'WEST'))
73
- add_period(TimezonePeriod.new(DateTime.new(2009,10,25,1,0,0),DateTime.new(2010,3,28,1,0,0),0,0,:'WET'))
74
- add_period(TimezonePeriod.new(DateTime.new(2010,3,28,1,0,0),DateTime.new(2010,10,31,1,0,0),0,3600,:'WEST'))
75
- add_period(TimezonePeriod.new(DateTime.new(2010,10,31,1,0,0),DateTime.new(2011,3,27,1,0,0),0,0,:'WET'))
76
- add_period(TimezonePeriod.new(DateTime.new(2011,3,27,1,0,0),DateTime.new(2011,10,30,1,0,0),0,3600,:'WEST'))
77
- add_period(TimezonePeriod.new(DateTime.new(2011,10,30,1,0,0),DateTime.new(2012,3,25,1,0,0),0,0,:'WET'))
78
- add_period(TimezonePeriod.new(DateTime.new(2012,3,25,1,0,0),DateTime.new(2012,10,28,1,0,0),0,3600,:'WEST'))
79
- add_period(TimezonePeriod.new(DateTime.new(2012,10,28,1,0,0),DateTime.new(2013,3,31,1,0,0),0,0,:'WET'))
80
- add_period(TimezonePeriod.new(DateTime.new(2013,3,31,1,0,0),DateTime.new(2013,10,27,1,0,0),0,3600,:'WEST'))
81
- add_period(TimezonePeriod.new(DateTime.new(2013,10,27,1,0,0),DateTime.new(2014,3,30,1,0,0),0,0,:'WET'))
82
- add_period(TimezonePeriod.new(DateTime.new(2014,3,30,1,0,0),DateTime.new(2014,10,26,1,0,0),0,3600,:'WEST'))
83
- add_period(TimezonePeriod.new(DateTime.new(2014,10,26,1,0,0),DateTime.new(2015,3,29,1,0,0),0,0,:'WET'))
84
- add_period(TimezonePeriod.new(DateTime.new(2015,3,29,1,0,0),DateTime.new(2015,10,25,1,0,0),0,3600,:'WEST'))
85
- add_period(TimezonePeriod.new(DateTime.new(2015,10,25,1,0,0),DateTime.new(2016,3,27,1,0,0),0,0,:'WET'))
86
- add_period(TimezonePeriod.new(DateTime.new(2016,3,27,1,0,0),DateTime.new(2016,10,30,1,0,0),0,3600,:'WEST'))
87
- add_period(TimezonePeriod.new(DateTime.new(2016,10,30,1,0,0),DateTime.new(2017,3,26,1,0,0),0,0,:'WET'))
88
- add_period(TimezonePeriod.new(DateTime.new(2017,3,26,1,0,0),DateTime.new(2017,10,29,1,0,0),0,3600,:'WEST'))
89
- add_period(TimezonePeriod.new(DateTime.new(2017,10,29,1,0,0),DateTime.new(2018,3,25,1,0,0),0,0,:'WET'))
90
- add_period(TimezonePeriod.new(DateTime.new(2018,3,25,1,0,0),DateTime.new(2018,10,28,1,0,0),0,3600,:'WEST'))
91
- add_period(TimezonePeriod.new(DateTime.new(2018,10,28,1,0,0),DateTime.new(2019,3,31,1,0,0),0,0,:'WET'))
92
- add_period(TimezonePeriod.new(DateTime.new(2019,3,31,1,0,0),DateTime.new(2019,10,27,1,0,0),0,3600,:'WEST'))
93
- add_period(TimezonePeriod.new(DateTime.new(2019,10,27,1,0,0),DateTime.new(2020,3,29,1,0,0),0,0,:'WET'))
94
- add_period(TimezonePeriod.new(DateTime.new(2020,3,29,1,0,0),DateTime.new(2020,10,25,1,0,0),0,3600,:'WEST'))
95
- add_period(TimezonePeriod.new(DateTime.new(2020,10,25,1,0,0),DateTime.new(2021,3,28,1,0,0),0,0,:'WET'))
96
- add_period(TimezonePeriod.new(DateTime.new(2021,3,28,1,0,0),DateTime.new(2021,10,31,1,0,0),0,3600,:'WEST'))
97
- add_period(TimezonePeriod.new(DateTime.new(2021,10,31,1,0,0),DateTime.new(2022,3,27,1,0,0),0,0,:'WET'))
98
- add_period(TimezonePeriod.new(DateTime.new(2022,3,27,1,0,0),DateTime.new(2022,10,30,1,0,0),0,3600,:'WEST'))
99
- add_period(TimezonePeriod.new(DateTime.new(2022,10,30,1,0,0),DateTime.new(2023,3,26,1,0,0),0,0,:'WET'))
100
- add_period(TimezonePeriod.new(DateTime.new(2023,3,26,1,0,0),DateTime.new(2023,10,29,1,0,0),0,3600,:'WEST'))
101
- add_period(TimezonePeriod.new(DateTime.new(2023,10,29,1,0,0),DateTime.new(2024,3,31,1,0,0),0,0,:'WET'))
102
- add_period(TimezonePeriod.new(DateTime.new(2024,3,31,1,0,0),DateTime.new(2024,10,27,1,0,0),0,3600,:'WEST'))
103
- add_period(TimezonePeriod.new(DateTime.new(2024,10,27,1,0,0),DateTime.new(2025,3,30,1,0,0),0,0,:'WET'))
104
- add_period(TimezonePeriod.new(DateTime.new(2025,3,30,1,0,0),DateTime.new(2025,10,26,1,0,0),0,3600,:'WEST'))
105
- add_period(TimezonePeriod.new(DateTime.new(2025,10,26,1,0,0),DateTime.new(2026,3,29,1,0,0),0,0,:'WET'))
106
- add_period(TimezonePeriod.new(DateTime.new(2026,3,29,1,0,0),DateTime.new(2026,10,25,1,0,0),0,3600,:'WEST'))
107
- add_period(TimezonePeriod.new(DateTime.new(2026,10,25,1,0,0),DateTime.new(2027,3,28,1,0,0),0,0,:'WET'))
108
- add_period(TimezonePeriod.new(DateTime.new(2027,3,28,1,0,0),DateTime.new(2027,10,31,1,0,0),0,3600,:'WEST'))
109
- add_period(TimezonePeriod.new(DateTime.new(2027,10,31,1,0,0),DateTime.new(2028,3,26,1,0,0),0,0,:'WET'))
110
- add_period(TimezonePeriod.new(DateTime.new(2028,3,26,1,0,0),DateTime.new(2028,10,29,1,0,0),0,3600,:'WEST'))
111
- add_period(TimezonePeriod.new(DateTime.new(2028,10,29,1,0,0),DateTime.new(2029,3,25,1,0,0),0,0,:'WET'))
112
- add_period(TimezonePeriod.new(DateTime.new(2029,3,25,1,0,0),DateTime.new(2029,10,28,1,0,0),0,3600,:'WEST'))
113
- add_period(TimezonePeriod.new(DateTime.new(2029,10,28,1,0,0),DateTime.new(2030,3,31,1,0,0),0,0,:'WET'))
114
- add_period(TimezonePeriod.new(DateTime.new(2030,3,31,1,0,0),DateTime.new(2030,10,27,1,0,0),0,3600,:'WEST'))
115
- add_period(TimezonePeriod.new(DateTime.new(2030,10,27,1,0,0),DateTime.new(2031,3,30,1,0,0),0,0,:'WET'))
116
- add_period(TimezonePeriod.new(DateTime.new(2031,3,30,1,0,0),DateTime.new(2031,10,26,1,0,0),0,3600,:'WEST'))
117
- add_period(TimezonePeriod.new(DateTime.new(2031,10,26,1,0,0),DateTime.new(2032,3,28,1,0,0),0,0,:'WET'))
118
- add_period(TimezonePeriod.new(DateTime.new(2032,3,28,1,0,0),DateTime.new(2032,10,31,1,0,0),0,3600,:'WEST'))
119
- add_period(TimezonePeriod.new(DateTime.new(2032,10,31,1,0,0),DateTime.new(2033,3,27,1,0,0),0,0,:'WET'))
120
- add_period(TimezonePeriod.new(DateTime.new(2033,3,27,1,0,0),DateTime.new(2033,10,30,1,0,0),0,3600,:'WEST'))
121
- add_period(TimezonePeriod.new(DateTime.new(2033,10,30,1,0,0),DateTime.new(2034,3,26,1,0,0),0,0,:'WET'))
122
- add_period(TimezonePeriod.new(DateTime.new(2034,3,26,1,0,0),DateTime.new(2034,10,29,1,0,0),0,3600,:'WEST'))
123
- add_period(TimezonePeriod.new(DateTime.new(2034,10,29,1,0,0),DateTime.new(2035,3,25,1,0,0),0,0,:'WET'))
124
- add_period(TimezonePeriod.new(DateTime.new(2035,3,25,1,0,0),DateTime.new(2035,10,28,1,0,0),0,3600,:'WEST'))
125
- add_period(TimezonePeriod.new(DateTime.new(2035,10,28,1,0,0),DateTime.new(2036,3,30,1,0,0),0,0,:'WET'))
126
- add_period(TimezonePeriod.new(DateTime.new(2036,3,30,1,0,0),DateTime.new(2036,10,26,1,0,0),0,3600,:'WEST'))
127
- add_period(TimezonePeriod.new(DateTime.new(2036,10,26,1,0,0),DateTime.new(2037,3,29,1,0,0),0,0,:'WET'))
128
- add_period(TimezonePeriod.new(DateTime.new(2037,3,29,1,0,0),DateTime.new(2037,10,25,1,0,0),0,3600,:'WEST'))
129
- add_period(TimezonePeriod.new(DateTime.new(2037,10,25,1,0,0),DateTime.new(2038,3,28,1,0,0),0,0,:'WET'))
130
- add_period(TimezonePeriod.new(DateTime.new(2038,3,28,1,0,0),DateTime.new(2038,10,31,1,0,0),0,3600,:'WEST'))
131
- add_period(TimezonePeriod.new(DateTime.new(2038,10,31,1,0,0),DateTime.new(2039,3,27,1,0,0),0,0,:'WET'))
132
- add_period(TimezonePeriod.new(DateTime.new(2039,3,27,1,0,0),DateTime.new(2039,10,30,1,0,0),0,3600,:'WEST'))
133
- add_period(TimezonePeriod.new(DateTime.new(2039,10,30,1,0,0),DateTime.new(2040,3,25,1,0,0),0,0,:'WET'))
134
- add_period(TimezonePeriod.new(DateTime.new(2040,3,25,1,0,0),DateTime.new(2040,10,28,1,0,0),0,3600,:'WEST'))
135
- add_period(TimezonePeriod.new(DateTime.new(2040,10,28,1,0,0),DateTime.new(2041,3,31,1,0,0),0,0,:'WET'))
136
- add_period(TimezonePeriod.new(DateTime.new(2041,3,31,1,0,0),DateTime.new(2041,10,27,1,0,0),0,3600,:'WEST'))
137
- add_period(TimezonePeriod.new(DateTime.new(2041,10,27,1,0,0),DateTime.new(2042,3,30,1,0,0),0,0,:'WET'))
138
- add_period(TimezonePeriod.new(DateTime.new(2042,3,30,1,0,0),DateTime.new(2042,10,26,1,0,0),0,3600,:'WEST'))
139
- add_period(TimezonePeriod.new(DateTime.new(2042,10,26,1,0,0),DateTime.new(2043,3,29,1,0,0),0,0,:'WET'))
140
- add_period(TimezonePeriod.new(DateTime.new(2043,3,29,1,0,0),DateTime.new(2043,10,25,1,0,0),0,3600,:'WEST'))
141
- add_period(TimezonePeriod.new(DateTime.new(2043,10,25,1,0,0),DateTime.new(2044,3,27,1,0,0),0,0,:'WET'))
142
- add_period(TimezonePeriod.new(DateTime.new(2044,3,27,1,0,0),DateTime.new(2044,10,30,1,0,0),0,3600,:'WEST'))
143
- add_period(TimezonePeriod.new(DateTime.new(2044,10,30,1,0,0),DateTime.new(2045,3,26,1,0,0),0,0,:'WET'))
144
- add_period(TimezonePeriod.new(DateTime.new(2045,3,26,1,0,0),DateTime.new(2045,9,3,22,38,8),0,3600,:'WEST'))
7
+ add_period(1850,1) {TimezonePeriod.new(DateTime.new0(Rational.new!(4793517,2),0,Date::ITALY),DateTime.new0(Rational.new!(58637677,24),0,Date::ITALY),0,0,:'WET')}
8
+ add_period(1977,4) {TimezonePeriod.new(DateTime.new0(Rational.new!(58637677,24),0,Date::ITALY),DateTime.new0(Rational.new!(58641877,24),0,Date::ITALY),0,3600,:'WEST')}
9
+ add_period(1977,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58641877,24),0,Date::ITALY),DateTime.new0(Rational.new!(58646413,24),0,Date::ITALY),0,0,:'WET')}
10
+ add_period(1978,4) {TimezonePeriod.new(DateTime.new0(Rational.new!(58646413,24),0,Date::ITALY),DateTime.new0(Rational.new!(58650781,24),0,Date::ITALY),0,3600,:'WEST')}
11
+ add_period(1978,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58650781,24),0,Date::ITALY),DateTime.new0(Rational.new!(58655149,24),0,Date::ITALY),0,0,:'WET')}
12
+ add_period(1979,4) {TimezonePeriod.new(DateTime.new0(Rational.new!(58655149,24),0,Date::ITALY),DateTime.new0(Rational.new!(58659517,24),0,Date::ITALY),0,3600,:'WEST')}
13
+ add_period(1979,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58659517,24),0,Date::ITALY),DateTime.new0(Rational.new!(58664053,24),0,Date::ITALY),0,0,:'WET')}
14
+ add_period(1980,4) {TimezonePeriod.new(DateTime.new0(Rational.new!(58664053,24),0,Date::ITALY),DateTime.new0(Rational.new!(58668253,24),0,Date::ITALY),0,3600,:'WEST')}
15
+ add_period(1980,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58668253,24),0,Date::ITALY),DateTime.new0(Rational.new!(58672621,24),0,Date::ITALY),0,0,:'WET')}
16
+ add_period(1981,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58672621,24),0,Date::ITALY),DateTime.new0(Rational.new!(58676989,24),0,Date::ITALY),0,3600,:'WEST')}
17
+ add_period(1981,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58676989,24),0,Date::ITALY),DateTime.new0(Rational.new!(58681357,24),0,Date::ITALY),0,0,:'WET')}
18
+ add_period(1982,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58681357,24),0,Date::ITALY),DateTime.new0(Rational.new!(58685725,24),0,Date::ITALY),0,3600,:'WEST')}
19
+ add_period(1982,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58685725,24),0,Date::ITALY),DateTime.new0(Rational.new!(58690093,24),0,Date::ITALY),0,0,:'WET')}
20
+ add_period(1983,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58690093,24),0,Date::ITALY),DateTime.new0(Rational.new!(58694461,24),0,Date::ITALY),0,3600,:'WEST')}
21
+ add_period(1983,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58694461,24),0,Date::ITALY),DateTime.new0(Rational.new!(58698829,24),0,Date::ITALY),0,0,:'WET')}
22
+ add_period(1984,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58698829,24),0,Date::ITALY),DateTime.new0(Rational.new!(58703365,24),0,Date::ITALY),0,3600,:'WEST')}
23
+ add_period(1984,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58703365,24),0,Date::ITALY),DateTime.new0(Rational.new!(58707733,24),0,Date::ITALY),0,0,:'WET')}
24
+ add_period(1985,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58707733,24),0,Date::ITALY),DateTime.new0(Rational.new!(58712101,24),0,Date::ITALY),0,3600,:'WEST')}
25
+ add_period(1985,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58712101,24),0,Date::ITALY),DateTime.new0(Rational.new!(58716469,24),0,Date::ITALY),0,0,:'WET')}
26
+ add_period(1986,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58716469,24),0,Date::ITALY),DateTime.new0(Rational.new!(58720837,24),0,Date::ITALY),0,3600,:'WEST')}
27
+ add_period(1986,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58720837,24),0,Date::ITALY),DateTime.new0(Rational.new!(58725205,24),0,Date::ITALY),0,0,:'WET')}
28
+ add_period(1987,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58725205,24),0,Date::ITALY),DateTime.new0(Rational.new!(58729573,24),0,Date::ITALY),0,3600,:'WEST')}
29
+ add_period(1987,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58729573,24),0,Date::ITALY),DateTime.new0(Rational.new!(58733941,24),0,Date::ITALY),0,0,:'WET')}
30
+ add_period(1988,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58733941,24),0,Date::ITALY),DateTime.new0(Rational.new!(58738309,24),0,Date::ITALY),0,3600,:'WEST')}
31
+ add_period(1988,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58738309,24),0,Date::ITALY),DateTime.new0(Rational.new!(58742677,24),0,Date::ITALY),0,0,:'WET')}
32
+ add_period(1989,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58742677,24),0,Date::ITALY),DateTime.new0(Rational.new!(58747045,24),0,Date::ITALY),0,3600,:'WEST')}
33
+ add_period(1989,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58747045,24),0,Date::ITALY),DateTime.new0(Rational.new!(58751413,24),0,Date::ITALY),0,0,:'WET')}
34
+ add_period(1990,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58751413,24),0,Date::ITALY),DateTime.new0(Rational.new!(58755949,24),0,Date::ITALY),0,3600,:'WEST')}
35
+ add_period(1990,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58755949,24),0,Date::ITALY),DateTime.new0(Rational.new!(58760317,24),0,Date::ITALY),0,0,:'WET')}
36
+ add_period(1991,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58760317,24),0,Date::ITALY),DateTime.new0(Rational.new!(58764685,24),0,Date::ITALY),0,3600,:'WEST')}
37
+ add_period(1991,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58764685,24),0,Date::ITALY),DateTime.new0(Rational.new!(58769053,24),0,Date::ITALY),0,0,:'WET')}
38
+ add_period(1992,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58769053,24),0,Date::ITALY),DateTime.new0(Rational.new!(58773421,24),0,Date::ITALY),0,3600,:'WEST')}
39
+ add_period(1992,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58773421,24),0,Date::ITALY),DateTime.new0(Rational.new!(58777789,24),0,Date::ITALY),0,0,:'WET')}
40
+ add_period(1993,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58777789,24),0,Date::ITALY),DateTime.new0(Rational.new!(58782157,24),0,Date::ITALY),0,3600,:'WEST')}
41
+ add_period(1993,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58782157,24),0,Date::ITALY),DateTime.new0(Rational.new!(58786525,24),0,Date::ITALY),0,0,:'WET')}
42
+ add_period(1994,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58786525,24),0,Date::ITALY),DateTime.new0(Rational.new!(58790893,24),0,Date::ITALY),0,3600,:'WEST')}
43
+ add_period(1994,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58790893,24),0,Date::ITALY),DateTime.new0(Rational.new!(58795261,24),0,Date::ITALY),0,0,:'WET')}
44
+ add_period(1995,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58795261,24),0,Date::ITALY),DateTime.new0(Rational.new!(58799629,24),0,Date::ITALY),0,3600,:'WEST')}
45
+ add_period(1995,9) {TimezonePeriod.new(DateTime.new0(Rational.new!(58799629,24),0,Date::ITALY),DateTime.new0(Rational.new!(58804165,24),0,Date::ITALY),0,0,:'WET')}
46
+ add_period(1996,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58804165,24),0,Date::ITALY),DateTime.new0(Rational.new!(58809205,24),0,Date::ITALY),0,3600,:'WEST')}
47
+ add_period(1996,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58809205,24),0,Date::ITALY),DateTime.new0(Rational.new!(58812901,24),0,Date::ITALY),0,0,:'WET')}
48
+ add_period(1997,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58812901,24),0,Date::ITALY),DateTime.new0(Rational.new!(58817941,24),0,Date::ITALY),0,3600,:'WEST')}
49
+ add_period(1997,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58817941,24),0,Date::ITALY),DateTime.new0(Rational.new!(58821637,24),0,Date::ITALY),0,0,:'WET')}
50
+ add_period(1998,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58821637,24),0,Date::ITALY),DateTime.new0(Rational.new!(58826677,24),0,Date::ITALY),0,3600,:'WEST')}
51
+ add_period(1998,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58826677,24),0,Date::ITALY),DateTime.new0(Rational.new!(58830373,24),0,Date::ITALY),0,0,:'WET')}
52
+ add_period(1999,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58830373,24),0,Date::ITALY),DateTime.new0(Rational.new!(58835581,24),0,Date::ITALY),0,3600,:'WEST')}
53
+ add_period(1999,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58835581,24),0,Date::ITALY),DateTime.new0(Rational.new!(58839109,24),0,Date::ITALY),0,0,:'WET')}
54
+ add_period(2000,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58839109,24),0,Date::ITALY),DateTime.new0(Rational.new!(58844317,24),0,Date::ITALY),0,3600,:'WEST')}
55
+ add_period(2000,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58844317,24),0,Date::ITALY),DateTime.new0(Rational.new!(58847845,24),0,Date::ITALY),0,0,:'WET')}
56
+ add_period(2001,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58847845,24),0,Date::ITALY),DateTime.new0(Rational.new!(58853053,24),0,Date::ITALY),0,3600,:'WEST')}
57
+ add_period(2001,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58853053,24),0,Date::ITALY),DateTime.new0(Rational.new!(58856749,24),0,Date::ITALY),0,0,:'WET')}
58
+ add_period(2002,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58856749,24),0,Date::ITALY),DateTime.new0(Rational.new!(58861789,24),0,Date::ITALY),0,3600,:'WEST')}
59
+ add_period(2002,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58861789,24),0,Date::ITALY),DateTime.new0(Rational.new!(58865485,24),0,Date::ITALY),0,0,:'WET')}
60
+ add_period(2003,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58865485,24),0,Date::ITALY),DateTime.new0(Rational.new!(58870525,24),0,Date::ITALY),0,3600,:'WEST')}
61
+ add_period(2003,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58870525,24),0,Date::ITALY),DateTime.new0(Rational.new!(58874221,24),0,Date::ITALY),0,0,:'WET')}
62
+ add_period(2004,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58874221,24),0,Date::ITALY),DateTime.new0(Rational.new!(58879429,24),0,Date::ITALY),0,3600,:'WEST')}
63
+ add_period(2004,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58879429,24),0,Date::ITALY),DateTime.new0(Rational.new!(58882957,24),0,Date::ITALY),0,0,:'WET')}
64
+ add_period(2005,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58882957,24),0,Date::ITALY),DateTime.new0(Rational.new!(58888165,24),0,Date::ITALY),0,3600,:'WEST')}
65
+ add_period(2005,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58888165,24),0,Date::ITALY),DateTime.new0(Rational.new!(58891693,24),0,Date::ITALY),0,0,:'WET')}
66
+ add_period(2006,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58891693,24),0,Date::ITALY),DateTime.new0(Rational.new!(58896901,24),0,Date::ITALY),0,3600,:'WEST')}
67
+ add_period(2006,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58896901,24),0,Date::ITALY),DateTime.new0(Rational.new!(58900429,24),0,Date::ITALY),0,0,:'WET')}
68
+ add_period(2007,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58900429,24),0,Date::ITALY),DateTime.new0(Rational.new!(58905637,24),0,Date::ITALY),0,3600,:'WEST')}
69
+ add_period(2007,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58905637,24),0,Date::ITALY),DateTime.new0(Rational.new!(58909333,24),0,Date::ITALY),0,0,:'WET')}
70
+ add_period(2008,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58909333,24),0,Date::ITALY),DateTime.new0(Rational.new!(58914373,24),0,Date::ITALY),0,3600,:'WEST')}
71
+ add_period(2008,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58914373,24),0,Date::ITALY),DateTime.new0(Rational.new!(58918069,24),0,Date::ITALY),0,0,:'WET')}
72
+ add_period(2009,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58918069,24),0,Date::ITALY),DateTime.new0(Rational.new!(58923109,24),0,Date::ITALY),0,3600,:'WEST')}
73
+ add_period(2009,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58923109,24),0,Date::ITALY),DateTime.new0(Rational.new!(58926805,24),0,Date::ITALY),0,0,:'WET')}
74
+ add_period(2010,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58926805,24),0,Date::ITALY),DateTime.new0(Rational.new!(58932013,24),0,Date::ITALY),0,3600,:'WEST')}
75
+ add_period(2010,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58932013,24),0,Date::ITALY),DateTime.new0(Rational.new!(58935541,24),0,Date::ITALY),0,0,:'WET')}
76
+ add_period(2011,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58935541,24),0,Date::ITALY),DateTime.new0(Rational.new!(58940749,24),0,Date::ITALY),0,3600,:'WEST')}
77
+ add_period(2011,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58940749,24),0,Date::ITALY),DateTime.new0(Rational.new!(58944277,24),0,Date::ITALY),0,0,:'WET')}
78
+ add_period(2012,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58944277,24),0,Date::ITALY),DateTime.new0(Rational.new!(58949485,24),0,Date::ITALY),0,3600,:'WEST')}
79
+ add_period(2012,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58949485,24),0,Date::ITALY),DateTime.new0(Rational.new!(58953181,24),0,Date::ITALY),0,0,:'WET')}
80
+ add_period(2013,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58953181,24),0,Date::ITALY),DateTime.new0(Rational.new!(58958221,24),0,Date::ITALY),0,3600,:'WEST')}
81
+ add_period(2013,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58958221,24),0,Date::ITALY),DateTime.new0(Rational.new!(58961917,24),0,Date::ITALY),0,0,:'WET')}
82
+ add_period(2014,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58961917,24),0,Date::ITALY),DateTime.new0(Rational.new!(58966957,24),0,Date::ITALY),0,3600,:'WEST')}
83
+ add_period(2014,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58966957,24),0,Date::ITALY),DateTime.new0(Rational.new!(58970653,24),0,Date::ITALY),0,0,:'WET')}
84
+ add_period(2015,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58970653,24),0,Date::ITALY),DateTime.new0(Rational.new!(58975693,24),0,Date::ITALY),0,3600,:'WEST')}
85
+ add_period(2015,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58975693,24),0,Date::ITALY),DateTime.new0(Rational.new!(58979389,24),0,Date::ITALY),0,0,:'WET')}
86
+ add_period(2016,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58979389,24),0,Date::ITALY),DateTime.new0(Rational.new!(58984597,24),0,Date::ITALY),0,3600,:'WEST')}
87
+ add_period(2016,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58984597,24),0,Date::ITALY),DateTime.new0(Rational.new!(58988125,24),0,Date::ITALY),0,0,:'WET')}
88
+ add_period(2017,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58988125,24),0,Date::ITALY),DateTime.new0(Rational.new!(58993333,24),0,Date::ITALY),0,3600,:'WEST')}
89
+ add_period(2017,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(58993333,24),0,Date::ITALY),DateTime.new0(Rational.new!(58996861,24),0,Date::ITALY),0,0,:'WET')}
90
+ add_period(2018,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(58996861,24),0,Date::ITALY),DateTime.new0(Rational.new!(59002069,24),0,Date::ITALY),0,3600,:'WEST')}
91
+ add_period(2018,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59002069,24),0,Date::ITALY),DateTime.new0(Rational.new!(59005765,24),0,Date::ITALY),0,0,:'WET')}
92
+ add_period(2019,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59005765,24),0,Date::ITALY),DateTime.new0(Rational.new!(59010805,24),0,Date::ITALY),0,3600,:'WEST')}
93
+ add_period(2019,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59010805,24),0,Date::ITALY),DateTime.new0(Rational.new!(59014501,24),0,Date::ITALY),0,0,:'WET')}
94
+ add_period(2020,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59014501,24),0,Date::ITALY),DateTime.new0(Rational.new!(59019541,24),0,Date::ITALY),0,3600,:'WEST')}
95
+ add_period(2020,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59019541,24),0,Date::ITALY),DateTime.new0(Rational.new!(59023237,24),0,Date::ITALY),0,0,:'WET')}
96
+ add_period(2021,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59023237,24),0,Date::ITALY),DateTime.new0(Rational.new!(59028445,24),0,Date::ITALY),0,3600,:'WEST')}
97
+ add_period(2021,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59028445,24),0,Date::ITALY),DateTime.new0(Rational.new!(59031973,24),0,Date::ITALY),0,0,:'WET')}
98
+ add_period(2022,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59031973,24),0,Date::ITALY),DateTime.new0(Rational.new!(59037181,24),0,Date::ITALY),0,3600,:'WEST')}
99
+ add_period(2022,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59037181,24),0,Date::ITALY),DateTime.new0(Rational.new!(59040709,24),0,Date::ITALY),0,0,:'WET')}
100
+ add_period(2023,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59040709,24),0,Date::ITALY),DateTime.new0(Rational.new!(59045917,24),0,Date::ITALY),0,3600,:'WEST')}
101
+ add_period(2023,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59045917,24),0,Date::ITALY),DateTime.new0(Rational.new!(59049613,24),0,Date::ITALY),0,0,:'WET')}
102
+ add_period(2024,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59049613,24),0,Date::ITALY),DateTime.new0(Rational.new!(59054653,24),0,Date::ITALY),0,3600,:'WEST')}
103
+ add_period(2024,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59054653,24),0,Date::ITALY),DateTime.new0(Rational.new!(59058349,24),0,Date::ITALY),0,0,:'WET')}
104
+ add_period(2025,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59058349,24),0,Date::ITALY),DateTime.new0(Rational.new!(59063389,24),0,Date::ITALY),0,3600,:'WEST')}
105
+ add_period(2025,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59063389,24),0,Date::ITALY),DateTime.new0(Rational.new!(59067085,24),0,Date::ITALY),0,0,:'WET')}
106
+ add_period(2026,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59067085,24),0,Date::ITALY),DateTime.new0(Rational.new!(59072125,24),0,Date::ITALY),0,3600,:'WEST')}
107
+ add_period(2026,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59072125,24),0,Date::ITALY),DateTime.new0(Rational.new!(59075821,24),0,Date::ITALY),0,0,:'WET')}
108
+ add_period(2027,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59075821,24),0,Date::ITALY),DateTime.new0(Rational.new!(59081029,24),0,Date::ITALY),0,3600,:'WEST')}
109
+ add_period(2027,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59081029,24),0,Date::ITALY),DateTime.new0(Rational.new!(59084557,24),0,Date::ITALY),0,0,:'WET')}
110
+ add_period(2028,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59084557,24),0,Date::ITALY),DateTime.new0(Rational.new!(59089765,24),0,Date::ITALY),0,3600,:'WEST')}
111
+ add_period(2028,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59089765,24),0,Date::ITALY),DateTime.new0(Rational.new!(59093293,24),0,Date::ITALY),0,0,:'WET')}
112
+ add_period(2029,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59093293,24),0,Date::ITALY),DateTime.new0(Rational.new!(59098501,24),0,Date::ITALY),0,3600,:'WEST')}
113
+ add_period(2029,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59098501,24),0,Date::ITALY),DateTime.new0(Rational.new!(59102197,24),0,Date::ITALY),0,0,:'WET')}
114
+ add_period(2030,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59102197,24),0,Date::ITALY),DateTime.new0(Rational.new!(59107237,24),0,Date::ITALY),0,3600,:'WEST')}
115
+ add_period(2030,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59107237,24),0,Date::ITALY),DateTime.new0(Rational.new!(59110933,24),0,Date::ITALY),0,0,:'WET')}
116
+ add_period(2031,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59110933,24),0,Date::ITALY),DateTime.new0(Rational.new!(59115973,24),0,Date::ITALY),0,3600,:'WEST')}
117
+ add_period(2031,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59115973,24),0,Date::ITALY),DateTime.new0(Rational.new!(59119669,24),0,Date::ITALY),0,0,:'WET')}
118
+ add_period(2032,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59119669,24),0,Date::ITALY),DateTime.new0(Rational.new!(59124877,24),0,Date::ITALY),0,3600,:'WEST')}
119
+ add_period(2032,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59124877,24),0,Date::ITALY),DateTime.new0(Rational.new!(59128405,24),0,Date::ITALY),0,0,:'WET')}
120
+ add_period(2033,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59128405,24),0,Date::ITALY),DateTime.new0(Rational.new!(59133613,24),0,Date::ITALY),0,3600,:'WEST')}
121
+ add_period(2033,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59133613,24),0,Date::ITALY),DateTime.new0(Rational.new!(59137141,24),0,Date::ITALY),0,0,:'WET')}
122
+ add_period(2034,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59137141,24),0,Date::ITALY),DateTime.new0(Rational.new!(59142349,24),0,Date::ITALY),0,3600,:'WEST')}
123
+ add_period(2034,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59142349,24),0,Date::ITALY),DateTime.new0(Rational.new!(59145877,24),0,Date::ITALY),0,0,:'WET')}
124
+ add_period(2035,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59145877,24),0,Date::ITALY),DateTime.new0(Rational.new!(59151085,24),0,Date::ITALY),0,3600,:'WEST')}
125
+ add_period(2035,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59151085,24),0,Date::ITALY),DateTime.new0(Rational.new!(59154781,24),0,Date::ITALY),0,0,:'WET')}
126
+ add_period(2036,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59154781,24),0,Date::ITALY),DateTime.new0(Rational.new!(59159821,24),0,Date::ITALY),0,3600,:'WEST')}
127
+ add_period(2036,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59159821,24),0,Date::ITALY),DateTime.new0(Rational.new!(59163517,24),0,Date::ITALY),0,0,:'WET')}
128
+ add_period(2037,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59163517,24),0,Date::ITALY),DateTime.new0(Rational.new!(59168557,24),0,Date::ITALY),0,3600,:'WEST')}
129
+ add_period(2037,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59168557,24),0,Date::ITALY),DateTime.new0(Rational.new!(59172253,24),0,Date::ITALY),0,0,:'WET')}
130
+ add_period(2038,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59172253,24),0,Date::ITALY),DateTime.new0(Rational.new!(59177461,24),0,Date::ITALY),0,3600,:'WEST')}
131
+ add_period(2038,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59177461,24),0,Date::ITALY),DateTime.new0(Rational.new!(59180989,24),0,Date::ITALY),0,0,:'WET')}
132
+ add_period(2039,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59180989,24),0,Date::ITALY),DateTime.new0(Rational.new!(59186197,24),0,Date::ITALY),0,3600,:'WEST')}
133
+ add_period(2039,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59186197,24),0,Date::ITALY),DateTime.new0(Rational.new!(59189725,24),0,Date::ITALY),0,0,:'WET')}
134
+ add_period(2040,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59189725,24),0,Date::ITALY),DateTime.new0(Rational.new!(59194933,24),0,Date::ITALY),0,3600,:'WEST')}
135
+ add_period(2040,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59194933,24),0,Date::ITALY),DateTime.new0(Rational.new!(59198629,24),0,Date::ITALY),0,0,:'WET')}
136
+ add_period(2041,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59198629,24),0,Date::ITALY),DateTime.new0(Rational.new!(59203669,24),0,Date::ITALY),0,3600,:'WEST')}
137
+ add_period(2041,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59203669,24),0,Date::ITALY),DateTime.new0(Rational.new!(59207365,24),0,Date::ITALY),0,0,:'WET')}
138
+ add_period(2042,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59207365,24),0,Date::ITALY),DateTime.new0(Rational.new!(59212405,24),0,Date::ITALY),0,3600,:'WEST')}
139
+ add_period(2042,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59212405,24),0,Date::ITALY),DateTime.new0(Rational.new!(59216101,24),0,Date::ITALY),0,0,:'WET')}
140
+ add_period(2043,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59216101,24),0,Date::ITALY),DateTime.new0(Rational.new!(59221141,24),0,Date::ITALY),0,3600,:'WEST')}
141
+ add_period(2043,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59221141,24),0,Date::ITALY),DateTime.new0(Rational.new!(59224837,24),0,Date::ITALY),0,0,:'WET')}
142
+ add_period(2044,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59224837,24),0,Date::ITALY),DateTime.new0(Rational.new!(59230045,24),0,Date::ITALY),0,3600,:'WEST')}
143
+ add_period(2044,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59230045,24),0,Date::ITALY),DateTime.new0(Rational.new!(59233573,24),0,Date::ITALY),0,0,:'WET')}
144
+ add_period(2045,3) {TimezonePeriod.new(DateTime.new0(Rational.new!(59233573,24),0,Date::ITALY),DateTime.new0(Rational.new!(59238781,24),0,Date::ITALY),0,3600,:'WEST')}
145
+ add_period(2045,10) {TimezonePeriod.new(DateTime.new0(Rational.new!(59238781,24),0,Date::ITALY),nil,0,0,:'WET')}
145
146
  end
146
147
  end
147
148
  end
@@ -1,8 +1,37 @@
1
+ #--
2
+ # Copyright (c) 2005 Philip Ross
3
+ #
4
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
5
+ # of this software and associated documentation files (the "Software"), to deal
6
+ # in the Software without restriction, including without limitation the rights
7
+ # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8
+ # copies of the Software, and to permit persons to whom the Software is
9
+ # furnished to do so, subject to the following conditions:
10
+ #
11
+ # The above copyright notice and this permission notice shall be included in all
12
+ # copies or substantial portions of the Software.
13
+ #
14
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16
+ # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19
+ # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
20
+ # THE SOFTWARE.
21
+ #++
22
+
23
+ require 'date'
1
24
  require 'tzinfo/country'
25
+ require 'tzinfo/timezone_period'
26
+ require 'tzinfo/timezone_period_list'
2
27
 
3
28
  module TZInfo
4
- # Thrown to indicate that no TimezonePeriod matching a given time could be found.
5
- class PeriodNotFound < StandardError
29
+ # Indicate a specified time in a local timezone has more than one
30
+ # possible time in UTC. This happens when switching from daylight savings time
31
+ # to normal time where the clocks are rolled back. Thrown by period_for_local
32
+ # and local_to_utc when using an ambiguous time and not specifying any
33
+ # means to resolve the ambiguity.
34
+ class AmbiguousTime < StandardError
6
35
  end
7
36
 
8
37
  # Thrown by Timezone#get if the identifier given is not valid.
@@ -23,24 +52,34 @@ module TZInfo
23
52
  class Timezone
24
53
  include Comparable
25
54
 
55
+ # Cache of loaded zones by identifier to avoid using require if a zone
56
+ # has already been loaded.
57
+ @@loaded_zones = {}
58
+
26
59
  # Returns a timezone by its identifier (e.g. "Europe/London",
27
60
  # "America/Chicago" or "UTC").
28
61
  #
29
62
  # Raises an exception of the timezone couldn't be found.
30
63
  def self.get(identifier)
31
- raise InvalidTimezoneIdentifier, 'Invalid identifier' if identifier !~ /^[A-z0-9\+\-_]+(\/[A-z0-9\+\-_]+)*$/
32
- identifier = identifier.gsub(/-/, '__m__').gsub(/\+/, '__p__')
33
- begin
34
- require "tzinfo/definitions/#{identifier}"
35
-
36
- m = Definitions
37
- identifier.split(/\//).each {|part|
38
- m = m.const_get(part)
39
- }
40
- m.instance
41
- rescue LoadError, NameError => e
42
- raise InvalidTimezoneIdentifier, e
64
+ instance = @@loaded_zones[identifier]
65
+ if instance.nil?
66
+ raise InvalidTimezoneIdentifier, 'Invalid identifier' if identifier !~ /^[A-z0-9\+\-_]+(\/[A-z0-9\+\-_]+)*$/
67
+ identifier = identifier.gsub(/-/, '__m__').gsub(/\+/, '__p__')
68
+ begin
69
+ require "tzinfo/definitions/#{identifier}"
70
+
71
+ m = Definitions
72
+ identifier.split(/\//).each {|part|
73
+ m = m.const_get(part)
74
+ }
75
+ instance = m.instance
76
+ @@loaded_zones[instance.identifier] = instance
77
+ rescue LoadError, NameError => e
78
+ raise InvalidTimezoneIdentifier, e.message
79
+ end
43
80
  end
81
+
82
+ instance
44
83
  end
45
84
 
46
85
  # If identifier is nil calls super(), else calls get(identifier). An
@@ -165,67 +204,76 @@ module TZInfo
165
204
  #
166
205
  # If no TimezonePeriod could be found, PeriodNotFound is raised.
167
206
  def period_for_utc(utc)
168
- run_on_datetime(utc) {|utc|
169
- # dumb search for now
170
- periods.each {|period|
171
- if period.valid_for_utc?(utc)
172
- return period
173
- end
174
- }
175
-
176
- # if nothing found, assume the first and last periods are unbounded
177
- if periods.length > 0
178
-
179
- last = periods[periods.length - 1]
180
- if last.utc_after_start?(utc)
181
- last
182
- else
183
- first = periods[0]
184
- if first.utc_before_end?(utc)
185
- first
186
- else
187
- raise PeriodNotFound, "No time period found for #{utc}"
188
- end
189
- end
190
- else
191
- raise PeriodNotFound, "No time period found for #{utc}"
192
- end
193
- }
207
+ utc = as_datetime(utc)
208
+ periods.period_for_utc(utc)
194
209
  end
195
210
 
196
211
  # Returns the TimezonePeriod for the given local time. local can either be
197
212
  # a DateTime or a Time. Any timezone information in local is ignored (it is
198
213
  # treated as a time in the current timezone).
199
214
  #
200
- # If no TimezonePeriod could be found, PeriodNotFound is raised. This will
201
- # happen when a change to daylight savings occurs and an hour is skipped.
202
- def period_for_local(local)
203
- run_on_datetime(local) {|local|
204
- # dumb search for now
205
- periods.each {|period|
206
- if period.valid_for_local?(local)
207
- return period
215
+ # Warning: There are local times that have no equivalent UTC times (e.g.
216
+ # in the transition from standard time to daylight savings time). There are
217
+ # also local times that have more than one UTC equivalent (e.g. in the
218
+ # transition from daylight savings time to standard time).
219
+ #
220
+ # In the first case (no equivalent UTC time), a PeriodNotFound exception
221
+ # will be thrown.
222
+ #
223
+ # In the second case (more than one equivalent UTC time), an AmbiguousTime
224
+ # exception will be thrown unless the optional dst parameter or block
225
+ # handles the ambiguity.
226
+ #
227
+ # If the ambiguity is due to a transition from daylight savings time to
228
+ # standard time, the dst parameter can be used to select whether the
229
+ # daylight savings time or local time is used. For example,
230
+ #
231
+ # Timezone.get('America/New_York').period_for_local(DateTime.new(2004,10,31,1,30,0))
232
+ #
233
+ # would raise an AmbiguousTime exception.
234
+ #
235
+ # Specifying dst=true would the daylight savings period from April to
236
+ # October 2004. Specifying dst=false would return the standard period
237
+ # from October 2004 to April 2005.
238
+ #
239
+ # If the dst parameter does not resolve the ambiguity, and a block is
240
+ # specified, it is called. The block must take a single parameter - an
241
+ # array of the periods that need to be resolved. The block can select and
242
+ # return a single period or return nil or an empty array
243
+ # to cause an AmbiguousTime exception to be raised.
244
+ def period_for_local(local, dst = nil)
245
+ local = as_datetime(local)
246
+ results = periods.periods_for_local(local)
247
+
248
+ # by this point, results must contain at least one period
249
+ if results.size < 2
250
+ results.first
251
+ else
252
+ # ambiguous result try to resolve
253
+
254
+ if !dst.nil?
255
+ matches = results.find_all {|period| period.dst? == dst}
256
+ results = matches if !matches.empty?
257
+ end
258
+
259
+ if results.size < 2
260
+ results.first
261
+ else
262
+ # still ambiguous, try the block
263
+
264
+ if block_given?
265
+ results = yield results
208
266
  end
209
- }
210
-
211
- # if nothing found, assume the first and last periods are unbounded
212
- if periods.length > 0
213
267
 
214
- last = periods[periods.length - 1]
215
- if last.local_after_start?(local)
216
- last
217
- else
218
- first = periods[0]
219
- if first.local_before_end?(local)
220
- first
221
- else
222
- raise PeriodNotFound, "No time period found for #{local}. This could be because a change to daylight savings time caused an hour to be skipped."
223
- end
268
+ if results.is_a?(TimezonePeriod)
269
+ results
270
+ elsif !results.nil? && results.size == 1
271
+ results.first
272
+ else
273
+ raise AmbiguousTime, "#{local} is an ambiguous local time."
224
274
  end
225
- else
226
- raise PeriodNotFound, "No time period found for #{local}. This could be because a change to daylight savings time caused an hour to be skipped."
227
275
  end
228
- }
276
+ end
229
277
  end
230
278
 
231
279
  # Converts a time in UTC to the local timezone. utc can either be
@@ -241,15 +289,43 @@ module TZInfo
241
289
  # a DateTime or a Time. The returned time has the same type as local.
242
290
  # Any timezone information in local is ignored (it is treated as a local time).
243
291
  #
244
- # During the period when daylight savings reverts to standard time and there
245
- # are two possible UTC times for each local time, local_to_utc returns the
246
- # earlier time.
292
+ # Warning: There are local times that have no equivalent UTC times (e.g.
293
+ # in the transition from standard time to daylight savings time). There are
294
+ # also local times that have more than one UTC equivalent (e.g. in the
295
+ # transition from daylight savings time to standard time).
296
+ #
297
+ # In the first case (no equivalent UTC time), a PeriodNotFound exception
298
+ # will be thrown.
299
+ #
300
+ # In the second case (more than one equivalent UTC time), an AmbiguousTime
301
+ # exception will be thrown unless the optional dst parameter or block
302
+ # handles the ambiguity.
247
303
  #
248
- # For times skipped during a change to daylight savings, PeriodNotFound is
249
- # raised.
250
- def local_to_utc(local)
251
- run_on_datetime(local) {|local|
252
- period_for_local(local).to_utc(local)
304
+ # If the ambiguity is due to a transition from daylight savings time to
305
+ # standard time, the dst parameter can be used to select whether the
306
+ # daylight savings time or local time is used. For example,
307
+ #
308
+ # Timezone.get('America/New_York').local_to_utc(DateTime.new(2004,10,31,1,30,0))
309
+ #
310
+ # would raise an AmbiguousTime exception.
311
+ #
312
+ # Specifying dst=true would return 2004-10-31 5:30:00. Specifying dst=false
313
+ # would return 2004-10-31 6:30:00.
314
+ #
315
+ # If the dst parameter does not resolve the ambiguity, and a block is
316
+ # specified, it is called. The block must take a single parameter - an
317
+ # array of the periods that need to be resolved. The block can return a
318
+ # single period to use to convert the time or return nil or an empty array
319
+ # to cause an AmbiguousTime exception to be raised.
320
+ def local_to_utc(local, dst = nil)
321
+ run_on_datetime(local) {|local|
322
+ if block_given?
323
+ period = period_for_local(local, dst) {|periods| yield periods }
324
+ else
325
+ period = period_for_local(local, dst)
326
+ end
327
+
328
+ period.to_utc(local)
253
329
  }
254
330
  end
255
331
 
@@ -283,9 +359,9 @@ module TZInfo
283
359
  end
284
360
 
285
361
  protected
286
- def self.setup
362
+ def self.setup
287
363
  class_eval <<CODE
288
- @@periods = []
364
+ @@periods = TimezonePeriodList.new
289
365
  @@instance = new
290
366
 
291
367
  def identifier
@@ -297,13 +373,17 @@ module TZInfo
297
373
  end
298
374
 
299
375
  def periods
300
- @@periods.freeze
376
+ @@periods
301
377
  end
302
378
 
303
379
  protected
304
- def self.add_period(period)
305
- @@periods << period
306
- end
380
+ def self.add_period(year, month)
381
+ @@periods.add(year, month) { yield }
382
+ end
383
+
384
+ def self.add_unbounded_start_period
385
+ @@periods.add_unbounded_start { yield }
386
+ end
307
387
 
308
388
  def self.set_identifier(identifier)
309
389
  @@identifier = identifier
@@ -312,6 +392,16 @@ CODE
312
392
  end
313
393
 
314
394
  private
395
+ # If called with a Time, returns an equivalent DateTime; otherwise returns
396
+ # the datetime paramter.
397
+ def as_datetime(datetime)
398
+ if datetime.instance_of?(Time)
399
+ DateTime.new(datetime.year, datetime.mon, datetime.mday, datetime.hour, datetime.min, datetime.sec)
400
+ else
401
+ datetime
402
+ end
403
+ end
404
+
315
405
  # Executes a block with a DateTime. If datetime is a Time it will be
316
406
  # converted to a DateTime before yielding to the block and the result of
317
407
  # the block will be converted back to a Time.
@@ -360,100 +450,5 @@ CODE
360
450
  end
361
451
  @real_tz.periods
362
452
  end
363
- end
364
-
365
- # A period of time in a timezone where the same offset from UTC applies.
366
- class TimezonePeriod
367
- # Start time of the period (UTC). May be nil if unbounded.
368
- attr_reader :utc_start
369
-
370
- # End time of the period (UTC). May be nil if unbounded.
371
- attr_reader :utc_end
372
-
373
- # Base offset of the timezone from UTC (seconds).
374
- attr_reader :utc_offset
375
-
376
- # Offset from the local time where daylight savings is in effect (seconds).
377
- # E.g.: utc_offset could be -5 hours. Normally, std_offset would be 0.
378
- # During daylight savings, std_offset would become +1 hours.
379
- attr_reader :std_offset
380
-
381
- # The identifier of this period, e.g. "GMT" (Greenwich Mean Time) or "BST"
382
- # (British Summer Time) for "Europe/London". The returned identifier is a
383
- # symbol.
384
- attr_reader :zone_identifier
385
-
386
- # Start time of the period (local time). May be nil if unbounded.
387
- attr_reader :local_start
388
-
389
- # End time of the period (local time). May be nil if unbounded.
390
- attr_reader :local_end
391
-
392
- # Initializes a new TimezonePeriod.
393
- def initialize(utc_start, utc_end, utc_offset, std_offset, zone_identifier)
394
- @utc_start = utc_start
395
- @utc_end = utc_end
396
- @utc_offset = utc_offset
397
- @std_offset = std_offset
398
- @zone_identifier = zone_identifier
399
-
400
- @local_start = utc_start.nil? ? nil : to_local(utc_start)
401
- @local_end = utc_end.nil? ? nil : to_local(utc_end)
402
- end
403
-
404
- # Total offset from UTC (seconds). Equal to utc_offset + std_offset.
405
- def utc_total_offset
406
- utc_offset + std_offset
407
- end
408
-
409
- # Total offset from UTC (days). Result is a Rational.
410
- def utc_total_offset_rational
411
- Rational(utc_total_offset, 86400)
412
- end
413
-
414
- # true if daylight savings is in effect for this period; otherwise false.
415
- def dst?
416
- std_offset != 0
417
- end
418
-
419
- # true if this period is valid for the given utc DateTime; otherwise false.
420
- def valid_for_utc?(utc)
421
- utc_after_start?(utc) && utc_before_end?(utc)
422
- end
423
-
424
- # true if the given utc DateTime is after the start of the period (inclusive); otherwise false.
425
- def utc_after_start?(utc)
426
- @utc_start.nil? || @utc_start <= utc
427
- end
428
-
429
- # true if the given utc DateTime is before the end of the period (exclusive); otherwise false.
430
- def utc_before_end?(utc)
431
- @utc_end.nil? || @utc_end > utc
432
- end
433
-
434
- # true if this period is valid for the given local DateTime; otherwise false.
435
- def valid_for_local?(local)
436
- local_after_start?(local) && local_before_end?(local)
437
- end
438
-
439
- # true if the given local DateTime is after the start of the period (inclusive); otherwise false.
440
- def local_after_start?(local)
441
- @local_start.nil? || @local_start <= local
442
- end
443
-
444
- # true if the given local DateTime is before the end of the period (exclusive); otherwise false.
445
- def local_before_end?(local)
446
- @local_end.nil? || @local_end > local
447
- end
448
-
449
- # Converts a UTC DateTime to local time based on the offset of this period.
450
- def to_local(utc)
451
- utc + utc_total_offset_rational
452
- end
453
-
454
- # Converts a local DateTime to UTC based on the offset of this period.
455
- def to_utc(local)
456
- local - utc_total_offset_rational
457
- end
458
- end
453
+ end
459
454
  end