tzinfo 0.1.2 → 0.2.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 (802) hide show
  1. data/CHANGES +24 -0
  2. data/LICENSE +1 -1
  3. data/Rakefile +5 -1
  4. data/lib/tzinfo/countries/AD.rb +12 -12
  5. data/lib/tzinfo/countries/AE.rb +12 -12
  6. data/lib/tzinfo/countries/AF.rb +12 -12
  7. data/lib/tzinfo/countries/AG.rb +12 -12
  8. data/lib/tzinfo/countries/AI.rb +12 -12
  9. data/lib/tzinfo/countries/AL.rb +12 -12
  10. data/lib/tzinfo/countries/AM.rb +12 -12
  11. data/lib/tzinfo/countries/AN.rb +12 -12
  12. data/lib/tzinfo/countries/AO.rb +12 -12
  13. data/lib/tzinfo/countries/AQ.rb +21 -21
  14. data/lib/tzinfo/countries/AR.rb +21 -21
  15. data/lib/tzinfo/countries/AS.rb +12 -12
  16. data/lib/tzinfo/countries/AT.rb +12 -12
  17. data/lib/tzinfo/countries/AU.rb +22 -22
  18. data/lib/tzinfo/countries/AW.rb +12 -12
  19. data/lib/tzinfo/countries/AX.rb +12 -12
  20. data/lib/tzinfo/countries/AZ.rb +12 -12
  21. data/lib/tzinfo/countries/BA.rb +12 -12
  22. data/lib/tzinfo/countries/BB.rb +12 -12
  23. data/lib/tzinfo/countries/BD.rb +12 -12
  24. data/lib/tzinfo/countries/BE.rb +12 -12
  25. data/lib/tzinfo/countries/BF.rb +12 -12
  26. data/lib/tzinfo/countries/BG.rb +12 -12
  27. data/lib/tzinfo/countries/BH.rb +12 -12
  28. data/lib/tzinfo/countries/BI.rb +12 -12
  29. data/lib/tzinfo/countries/BJ.rb +12 -12
  30. data/lib/tzinfo/countries/BM.rb +12 -12
  31. data/lib/tzinfo/countries/BN.rb +12 -12
  32. data/lib/tzinfo/countries/BO.rb +12 -12
  33. data/lib/tzinfo/countries/BR.rb +26 -26
  34. data/lib/tzinfo/countries/BS.rb +12 -12
  35. data/lib/tzinfo/countries/BT.rb +12 -12
  36. data/lib/tzinfo/countries/BV.rb +11 -11
  37. data/lib/tzinfo/countries/BW.rb +12 -12
  38. data/lib/tzinfo/countries/BY.rb +12 -12
  39. data/lib/tzinfo/countries/BZ.rb +12 -12
  40. data/lib/tzinfo/countries/CA.rb +36 -36
  41. data/lib/tzinfo/countries/CC.rb +12 -12
  42. data/lib/tzinfo/countries/CD.rb +13 -13
  43. data/lib/tzinfo/countries/CF.rb +12 -12
  44. data/lib/tzinfo/countries/CG.rb +12 -12
  45. data/lib/tzinfo/countries/CH.rb +12 -12
  46. data/lib/tzinfo/countries/CI.rb +12 -12
  47. data/lib/tzinfo/countries/CK.rb +12 -12
  48. data/lib/tzinfo/countries/CL.rb +13 -13
  49. data/lib/tzinfo/countries/CM.rb +12 -12
  50. data/lib/tzinfo/countries/CN.rb +16 -16
  51. data/lib/tzinfo/countries/CO.rb +12 -12
  52. data/lib/tzinfo/countries/CR.rb +12 -12
  53. data/lib/tzinfo/countries/CS.rb +12 -12
  54. data/lib/tzinfo/countries/CU.rb +12 -12
  55. data/lib/tzinfo/countries/CV.rb +12 -12
  56. data/lib/tzinfo/countries/CX.rb +12 -12
  57. data/lib/tzinfo/countries/CY.rb +12 -12
  58. data/lib/tzinfo/countries/CZ.rb +12 -12
  59. data/lib/tzinfo/countries/DE.rb +12 -12
  60. data/lib/tzinfo/countries/DJ.rb +12 -12
  61. data/lib/tzinfo/countries/DK.rb +12 -12
  62. data/lib/tzinfo/countries/DM.rb +12 -12
  63. data/lib/tzinfo/countries/DO.rb +12 -12
  64. data/lib/tzinfo/countries/DZ.rb +12 -12
  65. data/lib/tzinfo/countries/EC.rb +13 -13
  66. data/lib/tzinfo/countries/EE.rb +12 -12
  67. data/lib/tzinfo/countries/EG.rb +12 -12
  68. data/lib/tzinfo/countries/EH.rb +12 -12
  69. data/lib/tzinfo/countries/ER.rb +12 -12
  70. data/lib/tzinfo/countries/ES.rb +14 -14
  71. data/lib/tzinfo/countries/ET.rb +12 -12
  72. data/lib/tzinfo/countries/FI.rb +12 -12
  73. data/lib/tzinfo/countries/FJ.rb +12 -12
  74. data/lib/tzinfo/countries/FK.rb +12 -12
  75. data/lib/tzinfo/countries/FM.rb +14 -14
  76. data/lib/tzinfo/countries/FO.rb +12 -12
  77. data/lib/tzinfo/countries/FR.rb +12 -12
  78. data/lib/tzinfo/countries/GA.rb +12 -12
  79. data/lib/tzinfo/countries/GB.rb +12 -12
  80. data/lib/tzinfo/countries/GD.rb +12 -12
  81. data/lib/tzinfo/countries/GE.rb +12 -12
  82. data/lib/tzinfo/countries/GF.rb +12 -12
  83. data/lib/tzinfo/countries/GH.rb +12 -12
  84. data/lib/tzinfo/countries/GI.rb +12 -12
  85. data/lib/tzinfo/countries/GL.rb +15 -15
  86. data/lib/tzinfo/countries/GM.rb +12 -12
  87. data/lib/tzinfo/countries/GN.rb +12 -12
  88. data/lib/tzinfo/countries/GP.rb +12 -12
  89. data/lib/tzinfo/countries/GQ.rb +12 -12
  90. data/lib/tzinfo/countries/GR.rb +12 -12
  91. data/lib/tzinfo/countries/GS.rb +12 -12
  92. data/lib/tzinfo/countries/GT.rb +12 -12
  93. data/lib/tzinfo/countries/GU.rb +12 -12
  94. data/lib/tzinfo/countries/GW.rb +12 -12
  95. data/lib/tzinfo/countries/GY.rb +12 -12
  96. data/lib/tzinfo/countries/HK.rb +12 -12
  97. data/lib/tzinfo/countries/HM.rb +11 -11
  98. data/lib/tzinfo/countries/HN.rb +12 -12
  99. data/lib/tzinfo/countries/HR.rb +12 -12
  100. data/lib/tzinfo/countries/HT.rb +12 -12
  101. data/lib/tzinfo/countries/HU.rb +12 -12
  102. data/lib/tzinfo/countries/ID.rb +15 -15
  103. data/lib/tzinfo/countries/IE.rb +12 -12
  104. data/lib/tzinfo/countries/IL.rb +12 -12
  105. data/lib/tzinfo/countries/IN.rb +12 -12
  106. data/lib/tzinfo/countries/IO.rb +12 -12
  107. data/lib/tzinfo/countries/IQ.rb +12 -12
  108. data/lib/tzinfo/countries/IR.rb +12 -12
  109. data/lib/tzinfo/countries/IS.rb +12 -12
  110. data/lib/tzinfo/countries/IT.rb +12 -12
  111. data/lib/tzinfo/countries/JM.rb +12 -12
  112. data/lib/tzinfo/countries/JO.rb +12 -12
  113. data/lib/tzinfo/countries/JP.rb +12 -12
  114. data/lib/tzinfo/countries/KE.rb +12 -12
  115. data/lib/tzinfo/countries/KG.rb +12 -12
  116. data/lib/tzinfo/countries/KH.rb +12 -12
  117. data/lib/tzinfo/countries/KI.rb +14 -14
  118. data/lib/tzinfo/countries/KM.rb +12 -12
  119. data/lib/tzinfo/countries/KN.rb +12 -12
  120. data/lib/tzinfo/countries/KP.rb +12 -12
  121. data/lib/tzinfo/countries/KR.rb +12 -12
  122. data/lib/tzinfo/countries/KW.rb +12 -12
  123. data/lib/tzinfo/countries/KY.rb +12 -12
  124. data/lib/tzinfo/countries/KZ.rb +16 -16
  125. data/lib/tzinfo/countries/LA.rb +12 -12
  126. data/lib/tzinfo/countries/LB.rb +12 -12
  127. data/lib/tzinfo/countries/LC.rb +12 -12
  128. data/lib/tzinfo/countries/LI.rb +12 -12
  129. data/lib/tzinfo/countries/LK.rb +12 -12
  130. data/lib/tzinfo/countries/LR.rb +12 -12
  131. data/lib/tzinfo/countries/LS.rb +12 -12
  132. data/lib/tzinfo/countries/LT.rb +12 -12
  133. data/lib/tzinfo/countries/LU.rb +12 -12
  134. data/lib/tzinfo/countries/LV.rb +12 -12
  135. data/lib/tzinfo/countries/LY.rb +12 -12
  136. data/lib/tzinfo/countries/MA.rb +12 -12
  137. data/lib/tzinfo/countries/MC.rb +12 -12
  138. data/lib/tzinfo/countries/MD.rb +12 -12
  139. data/lib/tzinfo/countries/MG.rb +12 -12
  140. data/lib/tzinfo/countries/MH.rb +13 -13
  141. data/lib/tzinfo/countries/MK.rb +12 -12
  142. data/lib/tzinfo/countries/ML.rb +12 -12
  143. data/lib/tzinfo/countries/MM.rb +12 -12
  144. data/lib/tzinfo/countries/MN.rb +14 -14
  145. data/lib/tzinfo/countries/MO.rb +12 -12
  146. data/lib/tzinfo/countries/MP.rb +12 -12
  147. data/lib/tzinfo/countries/MQ.rb +12 -12
  148. data/lib/tzinfo/countries/MR.rb +12 -12
  149. data/lib/tzinfo/countries/MS.rb +12 -12
  150. data/lib/tzinfo/countries/MT.rb +12 -12
  151. data/lib/tzinfo/countries/MU.rb +12 -12
  152. data/lib/tzinfo/countries/MV.rb +12 -12
  153. data/lib/tzinfo/countries/MW.rb +12 -12
  154. data/lib/tzinfo/countries/MX.rb +19 -19
  155. data/lib/tzinfo/countries/MY.rb +13 -13
  156. data/lib/tzinfo/countries/MZ.rb +12 -12
  157. data/lib/tzinfo/countries/NA.rb +12 -12
  158. data/lib/tzinfo/countries/NC.rb +12 -12
  159. data/lib/tzinfo/countries/NE.rb +12 -12
  160. data/lib/tzinfo/countries/NF.rb +12 -12
  161. data/lib/tzinfo/countries/NG.rb +12 -12
  162. data/lib/tzinfo/countries/NI.rb +12 -12
  163. data/lib/tzinfo/countries/NL.rb +12 -12
  164. data/lib/tzinfo/countries/NO.rb +12 -12
  165. data/lib/tzinfo/countries/NP.rb +12 -12
  166. data/lib/tzinfo/countries/NR.rb +12 -12
  167. data/lib/tzinfo/countries/NU.rb +12 -12
  168. data/lib/tzinfo/countries/NZ.rb +13 -13
  169. data/lib/tzinfo/countries/OM.rb +12 -12
  170. data/lib/tzinfo/countries/PA.rb +12 -12
  171. data/lib/tzinfo/countries/PE.rb +12 -12
  172. data/lib/tzinfo/countries/PF.rb +14 -14
  173. data/lib/tzinfo/countries/PG.rb +12 -12
  174. data/lib/tzinfo/countries/PH.rb +12 -12
  175. data/lib/tzinfo/countries/PK.rb +12 -12
  176. data/lib/tzinfo/countries/PL.rb +12 -12
  177. data/lib/tzinfo/countries/PM.rb +12 -12
  178. data/lib/tzinfo/countries/PN.rb +12 -12
  179. data/lib/tzinfo/countries/PR.rb +12 -12
  180. data/lib/tzinfo/countries/PS.rb +12 -12
  181. data/lib/tzinfo/countries/PT.rb +14 -14
  182. data/lib/tzinfo/countries/PW.rb +12 -12
  183. data/lib/tzinfo/countries/PY.rb +12 -12
  184. data/lib/tzinfo/countries/QA.rb +12 -12
  185. data/lib/tzinfo/countries/RE.rb +12 -12
  186. data/lib/tzinfo/countries/RO.rb +12 -12
  187. data/lib/tzinfo/countries/RU.rb +25 -25
  188. data/lib/tzinfo/countries/RW.rb +12 -12
  189. data/lib/tzinfo/countries/SA.rb +12 -12
  190. data/lib/tzinfo/countries/SB.rb +12 -12
  191. data/lib/tzinfo/countries/SC.rb +12 -12
  192. data/lib/tzinfo/countries/SD.rb +12 -12
  193. data/lib/tzinfo/countries/SE.rb +12 -12
  194. data/lib/tzinfo/countries/SG.rb +12 -12
  195. data/lib/tzinfo/countries/SH.rb +12 -12
  196. data/lib/tzinfo/countries/SI.rb +12 -12
  197. data/lib/tzinfo/countries/SJ.rb +13 -13
  198. data/lib/tzinfo/countries/SK.rb +12 -12
  199. data/lib/tzinfo/countries/SL.rb +12 -12
  200. data/lib/tzinfo/countries/SM.rb +12 -12
  201. data/lib/tzinfo/countries/SN.rb +12 -12
  202. data/lib/tzinfo/countries/SO.rb +12 -12
  203. data/lib/tzinfo/countries/SR.rb +12 -12
  204. data/lib/tzinfo/countries/ST.rb +12 -12
  205. data/lib/tzinfo/countries/SV.rb +12 -12
  206. data/lib/tzinfo/countries/SY.rb +12 -12
  207. data/lib/tzinfo/countries/SZ.rb +12 -12
  208. data/lib/tzinfo/countries/TC.rb +12 -12
  209. data/lib/tzinfo/countries/TD.rb +12 -12
  210. data/lib/tzinfo/countries/TF.rb +12 -12
  211. data/lib/tzinfo/countries/TG.rb +12 -12
  212. data/lib/tzinfo/countries/TH.rb +12 -12
  213. data/lib/tzinfo/countries/TJ.rb +12 -12
  214. data/lib/tzinfo/countries/TK.rb +12 -12
  215. data/lib/tzinfo/countries/TL.rb +12 -12
  216. data/lib/tzinfo/countries/TM.rb +12 -12
  217. data/lib/tzinfo/countries/TN.rb +12 -12
  218. data/lib/tzinfo/countries/TO.rb +12 -12
  219. data/lib/tzinfo/countries/TR.rb +12 -12
  220. data/lib/tzinfo/countries/TT.rb +12 -12
  221. data/lib/tzinfo/countries/TV.rb +12 -12
  222. data/lib/tzinfo/countries/TW.rb +12 -12
  223. data/lib/tzinfo/countries/TZ.rb +12 -12
  224. data/lib/tzinfo/countries/UA.rb +15 -15
  225. data/lib/tzinfo/countries/UG.rb +12 -12
  226. data/lib/tzinfo/countries/UM.rb +14 -14
  227. data/lib/tzinfo/countries/US.rb +36 -35
  228. data/lib/tzinfo/countries/UY.rb +12 -12
  229. data/lib/tzinfo/countries/UZ.rb +13 -13
  230. data/lib/tzinfo/countries/VA.rb +12 -12
  231. data/lib/tzinfo/countries/VC.rb +12 -12
  232. data/lib/tzinfo/countries/VE.rb +12 -12
  233. data/lib/tzinfo/countries/VG.rb +12 -12
  234. data/lib/tzinfo/countries/VI.rb +12 -12
  235. data/lib/tzinfo/countries/VN.rb +12 -12
  236. data/lib/tzinfo/countries/VU.rb +12 -12
  237. data/lib/tzinfo/countries/WF.rb +12 -12
  238. data/lib/tzinfo/countries/WS.rb +12 -12
  239. data/lib/tzinfo/countries/YE.rb +12 -12
  240. data/lib/tzinfo/countries/YT.rb +12 -12
  241. data/lib/tzinfo/countries/ZA.rb +12 -12
  242. data/lib/tzinfo/countries/ZM.rb +12 -12
  243. data/lib/tzinfo/countries/ZW.rb +12 -12
  244. data/lib/tzinfo/definitions/Africa/Abidjan.rb +13 -13
  245. data/lib/tzinfo/definitions/Africa/Accra.rb +27 -27
  246. data/lib/tzinfo/definitions/Africa/Addis_Ababa.rb +14 -14
  247. data/lib/tzinfo/definitions/Africa/Algiers.rb +46 -46
  248. data/lib/tzinfo/definitions/Africa/Asmera.rb +15 -15
  249. data/lib/tzinfo/definitions/Africa/Bamako.rb +15 -15
  250. data/lib/tzinfo/definitions/Africa/Bangui.rb +13 -13
  251. data/lib/tzinfo/definitions/Africa/Banjul.rb +15 -15
  252. data/lib/tzinfo/definitions/Africa/Bissau.rb +14 -14
  253. data/lib/tzinfo/definitions/Africa/Blantyre.rb +13 -13
  254. data/lib/tzinfo/definitions/Africa/Brazzaville.rb +13 -13
  255. data/lib/tzinfo/definitions/Africa/Bujumbura.rb +13 -13
  256. data/lib/tzinfo/definitions/Africa/Cairo.rb +213 -203
  257. data/lib/tzinfo/definitions/Africa/Casablanca.rb +31 -31
  258. data/lib/tzinfo/definitions/Africa/Ceuta.rb +164 -157
  259. data/lib/tzinfo/definitions/Africa/Conakry.rb +15 -15
  260. data/lib/tzinfo/definitions/Africa/Dakar.rb +14 -14
  261. data/lib/tzinfo/definitions/Africa/Dar_es_Salaam.rb +15 -15
  262. data/lib/tzinfo/definitions/Africa/Djibouti.rb +13 -13
  263. data/lib/tzinfo/definitions/Africa/Douala.rb +13 -13
  264. data/lib/tzinfo/definitions/Africa/El_Aaiun.rb +14 -14
  265. data/lib/tzinfo/definitions/Africa/Freetown.rb +43 -43
  266. data/lib/tzinfo/definitions/Africa/Gaborone.rb +15 -15
  267. data/lib/tzinfo/definitions/Africa/Harare.rb +13 -13
  268. data/lib/tzinfo/definitions/Africa/Johannesburg.rb +18 -18
  269. data/lib/tzinfo/definitions/Africa/Kampala.rb +16 -16
  270. data/lib/tzinfo/definitions/Africa/Khartoum.rb +46 -46
  271. data/lib/tzinfo/definitions/Africa/Kigali.rb +13 -13
  272. data/lib/tzinfo/definitions/Africa/Kinshasa.rb +13 -13
  273. data/lib/tzinfo/definitions/Africa/Lagos.rb +13 -13
  274. data/lib/tzinfo/definitions/Africa/Libreville.rb +13 -13
  275. data/lib/tzinfo/definitions/Africa/Lome.rb +13 -13
  276. data/lib/tzinfo/definitions/Africa/Luanda.rb +14 -14
  277. data/lib/tzinfo/definitions/Africa/Lubumbashi.rb +13 -13
  278. data/lib/tzinfo/definitions/Africa/Lusaka.rb +13 -13
  279. data/lib/tzinfo/definitions/Africa/Malabo.rb +14 -14
  280. data/lib/tzinfo/definitions/Africa/Maputo.rb +13 -13
  281. data/lib/tzinfo/definitions/Africa/Maseru.rb +15 -15
  282. data/lib/tzinfo/definitions/Africa/Mbabane.rb +13 -13
  283. data/lib/tzinfo/definitions/Africa/Mogadishu.rb +15 -15
  284. data/lib/tzinfo/definitions/Africa/Monrovia.rb +15 -15
  285. data/lib/tzinfo/definitions/Africa/Nairobi.rb +16 -16
  286. data/lib/tzinfo/definitions/Africa/Ndjamena.rb +15 -15
  287. data/lib/tzinfo/definitions/Africa/Niamey.rb +15 -15
  288. data/lib/tzinfo/definitions/Africa/Nouakchott.rb +15 -15
  289. data/lib/tzinfo/definitions/Africa/Ouagadougou.rb +13 -13
  290. data/lib/tzinfo/definitions/Africa/Porto__m__Novo.rb +14 -14
  291. data/lib/tzinfo/definitions/Africa/Sao_Tome.rb +14 -14
  292. data/lib/tzinfo/definitions/Africa/Timbuktu.rb +11 -11
  293. data/lib/tzinfo/definitions/Africa/Tripoli.rb +41 -41
  294. data/lib/tzinfo/definitions/Africa/Tunis.rb +130 -40
  295. data/lib/tzinfo/definitions/Africa/Windhoek.rb +130 -121
  296. data/lib/tzinfo/definitions/America/Adak.rb +183 -175
  297. data/lib/tzinfo/definitions/America/Anchorage.rb +183 -175
  298. data/lib/tzinfo/definitions/America/Anguilla.rb +13 -13
  299. data/lib/tzinfo/definitions/America/Antigua.rb +14 -14
  300. data/lib/tzinfo/definitions/America/Araguaina.rb +61 -64
  301. data/lib/tzinfo/definitions/America/Argentina/Buenos_Aires.rb +71 -71
  302. data/lib/tzinfo/definitions/America/Argentina/Catamarca.rb +73 -73
  303. data/lib/tzinfo/definitions/America/Argentina/ComodRivadavia.rb +13 -13
  304. data/lib/tzinfo/definitions/America/Argentina/Cordoba.rb +71 -71
  305. data/lib/tzinfo/definitions/America/Argentina/Jujuy.rb +71 -72
  306. data/lib/tzinfo/definitions/America/Argentina/La_Rioja.rb +74 -74
  307. data/lib/tzinfo/definitions/America/Argentina/Mendoza.rb +73 -73
  308. data/lib/tzinfo/definitions/America/Argentina/Rio_Gallegos.rb +73 -73
  309. data/lib/tzinfo/definitions/America/Argentina/San_Juan.rb +74 -74
  310. data/lib/tzinfo/definitions/America/Argentina/Tucuman.rb +73 -73
  311. data/lib/tzinfo/definitions/America/Argentina/Ushuaia.rb +73 -73
  312. data/lib/tzinfo/definitions/America/Aruba.rb +14 -14
  313. data/lib/tzinfo/definitions/America/Asuncion.rb +166 -157
  314. data/lib/tzinfo/definitions/America/Atka.rb +11 -11
  315. data/lib/tzinfo/definitions/America/Bahia.rb +71 -72
  316. data/lib/tzinfo/definitions/America/Barbados.rb +22 -22
  317. data/lib/tzinfo/definitions/America/Belem.rb +41 -42
  318. data/lib/tzinfo/definitions/America/Belize.rb +67 -67
  319. data/lib/tzinfo/definitions/America/Boa_Vista.rb +45 -47
  320. data/lib/tzinfo/definitions/America/Bogota.rb +16 -16
  321. data/lib/tzinfo/definitions/America/Boise.rb +189 -178
  322. data/lib/tzinfo/definitions/America/Buenos_Aires.rb +11 -11
  323. data/lib/tzinfo/definitions/America/Cambridge_Bay.rb +165 -154
  324. data/lib/tzinfo/definitions/America/Campo_Grande.rb +165 -156
  325. data/lib/tzinfo/definitions/America/Cancun.rb +125 -115
  326. data/lib/tzinfo/definitions/America/Caracas.rb +15 -15
  327. data/lib/tzinfo/definitions/America/Catamarca.rb +11 -11
  328. data/lib/tzinfo/definitions/America/Cayenne.rb +14 -14
  329. data/lib/tzinfo/definitions/America/Cayman.rb +14 -14
  330. data/lib/tzinfo/definitions/America/Chicago.rb +274 -267
  331. data/lib/tzinfo/definitions/America/Chihuahua.rb +128 -120
  332. data/lib/tzinfo/definitions/America/Coral_Harbour.rb +20 -20
  333. data/lib/tzinfo/definitions/America/Cordoba.rb +11 -11
  334. data/lib/tzinfo/definitions/America/Costa_Rica.rb +22 -22
  335. data/lib/tzinfo/definitions/America/Cuiaba.rb +163 -156
  336. data/lib/tzinfo/definitions/America/Curacao.rb +14 -14
  337. data/lib/tzinfo/definitions/America/Danmarkshavn.rb +46 -46
  338. data/lib/tzinfo/definitions/America/Dawson.rb +165 -154
  339. data/lib/tzinfo/definitions/America/Dawson_Creek.rb +70 -70
  340. data/lib/tzinfo/definitions/America/Denver.rb +196 -189
  341. data/lib/tzinfo/definitions/America/Detroit.rb +177 -169
  342. data/lib/tzinfo/definitions/America/Dominica.rb +13 -13
  343. data/lib/tzinfo/definitions/America/Edmonton.rb +192 -181
  344. data/lib/tzinfo/definitions/America/Eirunepe.rb +43 -46
  345. data/lib/tzinfo/definitions/America/El_Salvador.rb +17 -17
  346. data/lib/tzinfo/definitions/America/Ensenada.rb +11 -11
  347. data/lib/tzinfo/definitions/America/Fort_Wayne.rb +11 -11
  348. data/lib/tzinfo/definitions/America/Fortaleza.rb +51 -55
  349. data/lib/tzinfo/definitions/America/Glace_Bay.rb +178 -171
  350. data/lib/tzinfo/definitions/America/Godthab.rb +155 -145
  351. data/lib/tzinfo/definitions/America/Goose_Bay.rb +242 -236
  352. data/lib/tzinfo/definitions/America/Grand_Turk.rb +158 -148
  353. data/lib/tzinfo/definitions/America/Grenada.rb +13 -13
  354. data/lib/tzinfo/definitions/America/Guadeloupe.rb +13 -13
  355. data/lib/tzinfo/definitions/America/Guatemala.rb +19 -19
  356. data/lib/tzinfo/definitions/America/Guayaquil.rb +14 -14
  357. data/lib/tzinfo/definitions/America/Guyana.rb +16 -16
  358. data/lib/tzinfo/definitions/America/Halifax.rb +266 -259
  359. data/lib/tzinfo/definitions/America/Havana.rb +194 -184
  360. data/lib/tzinfo/definitions/America/Hermosillo.rb +27 -28
  361. data/lib/tzinfo/definitions/America/Indiana/Indianapolis.rb +139 -134
  362. data/lib/tzinfo/definitions/America/Indiana/Knox.rb +194 -184
  363. data/lib/tzinfo/definitions/America/Indiana/Marengo.rb +143 -136
  364. data/lib/tzinfo/definitions/America/Indiana/Petersburg.rb +156 -146
  365. data/lib/tzinfo/definitions/America/Indiana/Vevay.rb +121 -113
  366. data/lib/tzinfo/definitions/America/Indiana/Vincennes.rb +141 -133
  367. data/lib/tzinfo/definitions/America/Indianapolis.rb +11 -11
  368. data/lib/tzinfo/definitions/America/Inuvik.rb +165 -154
  369. data/lib/tzinfo/definitions/America/Iqaluit.rb +164 -153
  370. data/lib/tzinfo/definitions/America/Jamaica.rb +34 -34
  371. data/lib/tzinfo/definitions/America/Jujuy.rb +11 -11
  372. data/lib/tzinfo/definitions/America/Juneau.rb +182 -174
  373. data/lib/tzinfo/definitions/America/Kentucky/Louisville.rb +218 -211
  374. data/lib/tzinfo/definitions/America/Kentucky/Monticello.rb +188 -179
  375. data/lib/tzinfo/definitions/America/Knox_IN.rb +11 -11
  376. data/lib/tzinfo/definitions/America/La_Paz.rb +15 -15
  377. data/lib/tzinfo/definitions/America/Lima.rb +28 -28
  378. data/lib/tzinfo/definitions/America/Los_Angeles.rb +224 -215
  379. data/lib/tzinfo/definitions/America/Louisville.rb +11 -11
  380. data/lib/tzinfo/definitions/America/Maceio.rb +53 -59
  381. data/lib/tzinfo/definitions/America/Managua.rb +26 -26
  382. data/lib/tzinfo/definitions/America/Manaus.rb +43 -46
  383. data/lib/tzinfo/definitions/America/Martinique.rb +16 -16
  384. data/lib/tzinfo/definitions/America/Mazatlan.rb +131 -121
  385. data/lib/tzinfo/definitions/America/Mendoza.rb +11 -11
  386. data/lib/tzinfo/definitions/America/Menominee.rb +181 -171
  387. data/lib/tzinfo/definitions/America/Merida.rb +125 -115
  388. data/lib/tzinfo/definitions/America/Mexico_City.rb +136 -127
  389. data/lib/tzinfo/definitions/America/Miquelon.rb +142 -133
  390. data/lib/tzinfo/definitions/America/Moncton.rb +245 -239
  391. data/lib/tzinfo/definitions/America/Monterrey.rb +125 -117
  392. data/lib/tzinfo/definitions/America/Montevideo.rb +81 -80
  393. data/lib/tzinfo/definitions/America/Montreal.rb +271 -264
  394. data/lib/tzinfo/definitions/America/Montserrat.rb +13 -13
  395. data/lib/tzinfo/definitions/America/Nassau.rb +187 -177
  396. data/lib/tzinfo/definitions/America/New_York.rb +274 -267
  397. data/lib/tzinfo/definitions/America/Nipigon.rb +173 -162
  398. data/lib/tzinfo/definitions/America/Nome.rb +183 -175
  399. data/lib/tzinfo/definitions/America/Noronha.rb +51 -55
  400. data/lib/tzinfo/definitions/America/North_Dakota/Center.rb +190 -179
  401. data/lib/tzinfo/definitions/America/North_Dakota/New_Salem.rb +190 -0
  402. data/lib/tzinfo/definitions/America/Panama.rb +14 -14
  403. data/lib/tzinfo/definitions/America/Pangnirtung.rb +164 -153
  404. data/lib/tzinfo/definitions/America/Paramaribo.rb +17 -17
  405. data/lib/tzinfo/definitions/America/Phoenix.rb +23 -25
  406. data/lib/tzinfo/definitions/America/Port__m__au__m__Prince.rb +46 -46
  407. data/lib/tzinfo/definitions/America/Port_of_Spain.rb +13 -13
  408. data/lib/tzinfo/definitions/America/Porto_Acre.rb +11 -11
  409. data/lib/tzinfo/definitions/America/Porto_Velho.rb +41 -42
  410. data/lib/tzinfo/definitions/America/Puerto_Rico.rb +16 -15
  411. data/lib/tzinfo/definitions/America/Rainy_River.rb +173 -162
  412. data/lib/tzinfo/definitions/America/Rankin_Inlet.rb +164 -153
  413. data/lib/tzinfo/definitions/America/Recife.rb +51 -55
  414. data/lib/tzinfo/definitions/America/Regina.rb +65 -64
  415. data/lib/tzinfo/definitions/America/Rio_Branco.rb +41 -42
  416. data/lib/tzinfo/definitions/America/Rosario.rb +11 -11
  417. data/lib/tzinfo/definitions/America/Santiago.rb +195 -186
  418. data/lib/tzinfo/definitions/America/Santo_Domingo.rb +29 -29
  419. data/lib/tzinfo/definitions/America/Sao_Paulo.rb +165 -157
  420. data/lib/tzinfo/definitions/America/Scoresbysund.rb +155 -145
  421. data/lib/tzinfo/definitions/America/Shiprock.rb +11 -11
  422. data/lib/tzinfo/definitions/America/St_Johns.rb +277 -270
  423. data/lib/tzinfo/definitions/America/St_Kitts.rb +13 -13
  424. data/lib/tzinfo/definitions/America/St_Lucia.rb +14 -14
  425. data/lib/tzinfo/definitions/America/St_Thomas.rb +13 -13
  426. data/lib/tzinfo/definitions/America/St_Vincent.rb +14 -14
  427. data/lib/tzinfo/definitions/America/Swift_Current.rb +35 -34
  428. data/lib/tzinfo/definitions/America/Tegucigalpa.rb +17 -17
  429. data/lib/tzinfo/definitions/America/Thule.rb +133 -123
  430. data/lib/tzinfo/definitions/America/Thunder_Bay.rb +177 -170
  431. data/lib/tzinfo/definitions/America/Tijuana.rb +187 -182
  432. data/lib/tzinfo/definitions/America/Toronto.rb +271 -263
  433. data/lib/tzinfo/definitions/America/Tortola.rb +13 -13
  434. data/lib/tzinfo/definitions/America/Vancouver.rb +228 -217
  435. data/lib/tzinfo/definitions/America/Virgin.rb +11 -11
  436. data/lib/tzinfo/definitions/America/Whitehorse.rb +165 -154
  437. data/lib/tzinfo/definitions/America/Winnipeg.rb +224 -213
  438. data/lib/tzinfo/definitions/America/Yakutat.rb +182 -174
  439. data/lib/tzinfo/definitions/America/Yellowknife.rb +164 -153
  440. data/lib/tzinfo/definitions/Antarctica/Casey.rb +13 -13
  441. data/lib/tzinfo/definitions/Antarctica/Davis.rb +15 -15
  442. data/lib/tzinfo/definitions/Antarctica/DumontDUrville.rb +15 -15
  443. data/lib/tzinfo/definitions/Antarctica/Mawson.rb +13 -13
  444. data/lib/tzinfo/definitions/Antarctica/McMurdo.rb +165 -156
  445. data/lib/tzinfo/definitions/Antarctica/Palmer.rb +168 -158
  446. data/lib/tzinfo/definitions/Antarctica/Rothera.rb +13 -13
  447. data/lib/tzinfo/definitions/Antarctica/South_Pole.rb +11 -11
  448. data/lib/tzinfo/definitions/Antarctica/Syowa.rb +13 -13
  449. data/lib/tzinfo/definitions/Antarctica/Vostok.rb +13 -13
  450. data/lib/tzinfo/definitions/Arctic/Longyearbyen.rb +11 -11
  451. data/lib/tzinfo/definitions/Asia/Aden.rb +13 -13
  452. data/lib/tzinfo/definitions/Asia/Almaty.rb +60 -63
  453. data/lib/tzinfo/definitions/Asia/Amman.rb +157 -147
  454. data/lib/tzinfo/definitions/Asia/Anadyr.rb +155 -145
  455. data/lib/tzinfo/definitions/Asia/Aqtau.rb +62 -63
  456. data/lib/tzinfo/definitions/Asia/Aqtobe.rb +61 -63
  457. data/lib/tzinfo/definitions/Asia/Ashgabat.rb +38 -38
  458. data/lib/tzinfo/definitions/Asia/Ashkhabad.rb +11 -11
  459. data/lib/tzinfo/definitions/Asia/Baghdad.rb +152 -142
  460. data/lib/tzinfo/definitions/Asia/Bahrain.rb +14 -14
  461. data/lib/tzinfo/definitions/Asia/Baku.rb +149 -141
  462. data/lib/tzinfo/definitions/Asia/Bangkok.rb +14 -14
  463. data/lib/tzinfo/definitions/Asia/Beirut.rb +179 -169
  464. data/lib/tzinfo/definitions/Asia/Bishkek.rb +64 -63
  465. data/lib/tzinfo/definitions/Asia/Brunei.rb +14 -14
  466. data/lib/tzinfo/definitions/Asia/Calcutta.rb +17 -17
  467. data/lib/tzinfo/definitions/Asia/Choibalsan.rb +146 -136
  468. data/lib/tzinfo/definitions/Asia/Chongqing.rb +26 -26
  469. data/lib/tzinfo/definitions/Asia/Chungking.rb +11 -11
  470. data/lib/tzinfo/definitions/Asia/Colombo.rb +20 -19
  471. data/lib/tzinfo/definitions/Asia/Dacca.rb +11 -11
  472. data/lib/tzinfo/definitions/Asia/Damascus.rb +189 -179
  473. data/lib/tzinfo/definitions/Asia/Dhaka.rb +18 -18
  474. data/lib/tzinfo/definitions/Asia/Dili.rb +17 -17
  475. data/lib/tzinfo/definitions/Asia/Dubai.rb +13 -13
  476. data/lib/tzinfo/definitions/Asia/Dushanbe.rb +36 -36
  477. data/lib/tzinfo/definitions/Asia/Gaza.rb +182 -173
  478. data/lib/tzinfo/definitions/Asia/Harbin.rb +29 -29
  479. data/lib/tzinfo/definitions/Asia/Hong_Kong.rb +81 -81
  480. data/lib/tzinfo/definitions/Asia/Hovd.rb +146 -136
  481. data/lib/tzinfo/definitions/Asia/Irkutsk.rb +156 -146
  482. data/lib/tzinfo/definitions/Asia/Istanbul.rb +11 -11
  483. data/lib/tzinfo/definitions/Asia/Jakarta.rb +20 -20
  484. data/lib/tzinfo/definitions/Asia/Jayapura.rb +15 -15
  485. data/lib/tzinfo/definitions/Asia/Jerusalem.rb +155 -155
  486. data/lib/tzinfo/definitions/Asia/Kabul.rb +14 -14
  487. data/lib/tzinfo/definitions/Asia/Kamchatka.rb +155 -145
  488. data/lib/tzinfo/definitions/Asia/Karachi.rb +19 -19
  489. data/lib/tzinfo/definitions/Asia/Kashgar.rb +27 -27
  490. data/lib/tzinfo/definitions/Asia/Katmandu.rb +14 -14
  491. data/lib/tzinfo/definitions/Asia/Krasnoyarsk.rb +155 -145
  492. data/lib/tzinfo/definitions/Asia/Kuala_Lumpur.rb +20 -20
  493. data/lib/tzinfo/definitions/Asia/Kuching.rb +31 -31
  494. data/lib/tzinfo/definitions/Asia/Kuwait.rb +13 -13
  495. data/lib/tzinfo/definitions/Asia/Macao.rb +11 -11
  496. data/lib/tzinfo/definitions/Asia/Macau.rb +54 -54
  497. data/lib/tzinfo/definitions/Asia/Magadan.rb +155 -145
  498. data/lib/tzinfo/definitions/Asia/Makassar.rb +16 -16
  499. data/lib/tzinfo/definitions/Asia/Manila.rb +22 -22
  500. data/lib/tzinfo/definitions/Asia/Muscat.rb +13 -13
  501. data/lib/tzinfo/definitions/Asia/Nicosia.rb +165 -156
  502. data/lib/tzinfo/definitions/Asia/Novosibirsk.rb +156 -146
  503. data/lib/tzinfo/definitions/Asia/Omsk.rb +155 -145
  504. data/lib/tzinfo/definitions/Asia/Oral.rb +62 -63
  505. data/lib/tzinfo/definitions/Asia/Phnom_Penh.rb +16 -16
  506. data/lib/tzinfo/definitions/Asia/Pontianak.rb +20 -20
  507. data/lib/tzinfo/definitions/Asia/Pyongyang.rb +18 -18
  508. data/lib/tzinfo/definitions/Asia/Qatar.rb +14 -14
  509. data/lib/tzinfo/definitions/Asia/Qyzylorda.rb +62 -64
  510. data/lib/tzinfo/definitions/Asia/Rangoon.rb +16 -16
  511. data/lib/tzinfo/definitions/Asia/Riyadh.rb +13 -13
  512. data/lib/tzinfo/definitions/Asia/Riyadh87.rb +348 -0
  513. data/lib/tzinfo/definitions/Asia/Riyadh88.rb +349 -0
  514. data/lib/tzinfo/definitions/Asia/Riyadh89.rb +349 -0
  515. data/lib/tzinfo/definitions/Asia/Saigon.rb +16 -16
  516. data/lib/tzinfo/definitions/Asia/Sakhalin.rb +156 -146
  517. data/lib/tzinfo/definitions/Asia/Samarkand.rb +37 -41
  518. data/lib/tzinfo/definitions/Asia/Seoul.rb +25 -25
  519. data/lib/tzinfo/definitions/Asia/Shanghai.rb +29 -30
  520. data/lib/tzinfo/definitions/Asia/Singapore.rb +21 -21
  521. data/lib/tzinfo/definitions/Asia/Taipei.rb +53 -53
  522. data/lib/tzinfo/definitions/Asia/Tashkent.rb +37 -41
  523. data/lib/tzinfo/definitions/Asia/Tbilisi.rb +65 -67
  524. data/lib/tzinfo/definitions/Asia/Tehran.rb +52 -116
  525. data/lib/tzinfo/definitions/Asia/Tel_Aviv.rb +11 -11
  526. data/lib/tzinfo/definitions/Asia/Thimbu.rb +11 -11
  527. data/lib/tzinfo/definitions/Asia/Thimphu.rb +14 -14
  528. data/lib/tzinfo/definitions/Asia/Tokyo.rb +23 -23
  529. data/lib/tzinfo/definitions/Asia/Ujung_Pandang.rb +11 -11
  530. data/lib/tzinfo/definitions/Asia/Ulaanbaatar.rb +146 -136
  531. data/lib/tzinfo/definitions/Asia/Ulan_Bator.rb +11 -11
  532. data/lib/tzinfo/definitions/Asia/Urumqi.rb +26 -26
  533. data/lib/tzinfo/definitions/Asia/Vientiane.rb +16 -16
  534. data/lib/tzinfo/definitions/Asia/Vladivostok.rb +155 -145
  535. data/lib/tzinfo/definitions/Asia/Yakutsk.rb +155 -145
  536. data/lib/tzinfo/definitions/Asia/Yekaterinburg.rb +155 -145
  537. data/lib/tzinfo/definitions/Asia/Yerevan.rb +153 -144
  538. data/lib/tzinfo/definitions/Atlantic/Azores.rb +259 -249
  539. data/lib/tzinfo/definitions/Atlantic/Bermuda.rb +167 -157
  540. data/lib/tzinfo/definitions/Atlantic/Canary.rb +156 -147
  541. data/lib/tzinfo/definitions/Atlantic/Cape_Verde.rb +16 -16
  542. data/lib/tzinfo/definitions/Atlantic/Faeroe.rb +153 -144
  543. data/lib/tzinfo/definitions/Atlantic/Jan_Mayen.rb +11 -11
  544. data/lib/tzinfo/definitions/Atlantic/Madeira.rb +259 -249
  545. data/lib/tzinfo/definitions/Atlantic/Reykjavik.rb +77 -77
  546. data/lib/tzinfo/definitions/Atlantic/South_Georgia.rb +13 -13
  547. data/lib/tzinfo/definitions/Atlantic/St_Helena.rb +14 -14
  548. data/lib/tzinfo/definitions/Atlantic/Stanley.rb +161 -152
  549. data/lib/tzinfo/definitions/Australia/ACT.rb +11 -11
  550. data/lib/tzinfo/definitions/Australia/Adelaide.rb +180 -172
  551. data/lib/tzinfo/definitions/Australia/Brisbane.rb +29 -30
  552. data/lib/tzinfo/definitions/Australia/Broken_Hill.rb +181 -174
  553. data/lib/tzinfo/definitions/Australia/Canberra.rb +11 -11
  554. data/lib/tzinfo/definitions/Australia/Currie.rb +179 -172
  555. data/lib/tzinfo/definitions/Australia/Darwin.rb +22 -22
  556. data/lib/tzinfo/definitions/Australia/Hobart.rb +187 -180
  557. data/lib/tzinfo/definitions/Australia/LHI.rb +11 -11
  558. data/lib/tzinfo/definitions/Australia/Lindeman.rb +33 -35
  559. data/lib/tzinfo/definitions/Australia/Lord_Howe.rb +152 -143
  560. data/lib/tzinfo/definitions/Australia/Melbourne.rb +179 -171
  561. data/lib/tzinfo/definitions/Australia/NSW.rb +11 -11
  562. data/lib/tzinfo/definitions/Australia/North.rb +11 -11
  563. data/lib/tzinfo/definitions/Australia/Perth.rb +25 -26
  564. data/lib/tzinfo/definitions/Australia/Queensland.rb +11 -11
  565. data/lib/tzinfo/definitions/Australia/South.rb +11 -11
  566. data/lib/tzinfo/definitions/Australia/Sydney.rb +179 -171
  567. data/lib/tzinfo/definitions/Australia/Tasmania.rb +11 -11
  568. data/lib/tzinfo/definitions/Australia/Victoria.rb +11 -11
  569. data/lib/tzinfo/definitions/Australia/West.rb +11 -11
  570. data/lib/tzinfo/definitions/Australia/Yancowinna.rb +11 -11
  571. data/lib/tzinfo/definitions/Brazil/Acre.rb +11 -11
  572. data/lib/tzinfo/definitions/Brazil/DeNoronha.rb +11 -11
  573. data/lib/tzinfo/definitions/Brazil/East.rb +11 -11
  574. data/lib/tzinfo/definitions/Brazil/West.rb +11 -11
  575. data/lib/tzinfo/definitions/CET.rb +170 -160
  576. data/lib/tzinfo/definitions/CST6CDT.rb +185 -174
  577. data/lib/tzinfo/definitions/Canada/Atlantic.rb +11 -11
  578. data/lib/tzinfo/definitions/Canada/Central.rb +11 -11
  579. data/lib/tzinfo/definitions/Canada/East__m__Saskatchewan.rb +11 -11
  580. data/lib/tzinfo/definitions/Canada/Eastern.rb +11 -11
  581. data/lib/tzinfo/definitions/Canada/Mountain.rb +11 -11
  582. data/lib/tzinfo/definitions/Canada/Newfoundland.rb +11 -11
  583. data/lib/tzinfo/definitions/Canada/Pacific.rb +11 -11
  584. data/lib/tzinfo/definitions/Canada/Saskatchewan.rb +11 -11
  585. data/lib/tzinfo/definitions/Canada/Yukon.rb +11 -11
  586. data/lib/tzinfo/definitions/Chile/Continental.rb +11 -11
  587. data/lib/tzinfo/definitions/Chile/EasterIsland.rb +11 -11
  588. data/lib/tzinfo/definitions/Cuba.rb +9 -9
  589. data/lib/tzinfo/definitions/EET.rb +158 -148
  590. data/lib/tzinfo/definitions/EST.rb +10 -10
  591. data/lib/tzinfo/definitions/EST5EDT.rb +185 -174
  592. data/lib/tzinfo/definitions/Egypt.rb +9 -9
  593. data/lib/tzinfo/definitions/Eire.rb +9 -9
  594. data/lib/tzinfo/definitions/Etc/GMT.rb +12 -12
  595. data/lib/tzinfo/definitions/Etc/GMT0.rb +11 -11
  596. data/lib/tzinfo/definitions/Etc/GMT__m__0.rb +11 -11
  597. data/lib/tzinfo/definitions/Etc/GMT__m__1.rb +12 -12
  598. data/lib/tzinfo/definitions/Etc/GMT__m__10.rb +12 -12
  599. data/lib/tzinfo/definitions/Etc/GMT__m__11.rb +12 -12
  600. data/lib/tzinfo/definitions/Etc/GMT__m__12.rb +12 -12
  601. data/lib/tzinfo/definitions/Etc/GMT__m__13.rb +12 -12
  602. data/lib/tzinfo/definitions/Etc/GMT__m__14.rb +12 -12
  603. data/lib/tzinfo/definitions/Etc/GMT__m__2.rb +12 -12
  604. data/lib/tzinfo/definitions/Etc/GMT__m__3.rb +12 -12
  605. data/lib/tzinfo/definitions/Etc/GMT__m__4.rb +12 -12
  606. data/lib/tzinfo/definitions/Etc/GMT__m__5.rb +12 -12
  607. data/lib/tzinfo/definitions/Etc/GMT__m__6.rb +12 -12
  608. data/lib/tzinfo/definitions/Etc/GMT__m__7.rb +12 -12
  609. data/lib/tzinfo/definitions/Etc/GMT__m__8.rb +12 -12
  610. data/lib/tzinfo/definitions/Etc/GMT__m__9.rb +12 -12
  611. data/lib/tzinfo/definitions/Etc/GMT__p__0.rb +11 -11
  612. data/lib/tzinfo/definitions/Etc/GMT__p__1.rb +12 -12
  613. data/lib/tzinfo/definitions/Etc/GMT__p__10.rb +12 -12
  614. data/lib/tzinfo/definitions/Etc/GMT__p__11.rb +12 -12
  615. data/lib/tzinfo/definitions/Etc/GMT__p__12.rb +12 -12
  616. data/lib/tzinfo/definitions/Etc/GMT__p__2.rb +12 -12
  617. data/lib/tzinfo/definitions/Etc/GMT__p__3.rb +12 -12
  618. data/lib/tzinfo/definitions/Etc/GMT__p__4.rb +12 -12
  619. data/lib/tzinfo/definitions/Etc/GMT__p__5.rb +12 -12
  620. data/lib/tzinfo/definitions/Etc/GMT__p__6.rb +12 -12
  621. data/lib/tzinfo/definitions/Etc/GMT__p__7.rb +12 -12
  622. data/lib/tzinfo/definitions/Etc/GMT__p__8.rb +12 -12
  623. data/lib/tzinfo/definitions/Etc/GMT__p__9.rb +12 -12
  624. data/lib/tzinfo/definitions/Etc/Greenwich.rb +11 -11
  625. data/lib/tzinfo/definitions/Etc/UCT.rb +12 -12
  626. data/lib/tzinfo/definitions/Etc/UTC.rb +12 -12
  627. data/lib/tzinfo/definitions/Etc/Universal.rb +11 -11
  628. data/lib/tzinfo/definitions/Etc/Zulu.rb +11 -11
  629. data/lib/tzinfo/definitions/Europe/Amsterdam.rb +218 -208
  630. data/lib/tzinfo/definitions/Europe/Andorra.rb +146 -136
  631. data/lib/tzinfo/definitions/Europe/Athens.rb +176 -167
  632. data/lib/tzinfo/definitions/Europe/Belfast.rb +11 -11
  633. data/lib/tzinfo/definitions/Europe/Belgrade.rb +157 -147
  634. data/lib/tzinfo/definitions/Europe/Berlin.rb +181 -172
  635. data/lib/tzinfo/definitions/Europe/Bratislava.rb +11 -11
  636. data/lib/tzinfo/definitions/Europe/Brussels.rb +223 -214
  637. data/lib/tzinfo/definitions/Europe/Bucharest.rb +174 -167
  638. data/lib/tzinfo/definitions/Europe/Budapest.rb +191 -181
  639. data/lib/tzinfo/definitions/Europe/Chisinau.rb +177 -170
  640. data/lib/tzinfo/definitions/Europe/Copenhagen.rb +172 -163
  641. data/lib/tzinfo/definitions/Europe/Dublin.rb +265 -257
  642. data/lib/tzinfo/definitions/Europe/Gibraltar.rb +236 -227
  643. data/lib/tzinfo/definitions/Europe/Helsinki.rb +156 -147
  644. data/lib/tzinfo/definitions/Europe/Istanbul.rb +209 -201
  645. data/lib/tzinfo/definitions/Europe/Kaliningrad.rb +169 -159
  646. data/lib/tzinfo/definitions/Europe/Kiev.rb +157 -149
  647. data/lib/tzinfo/definitions/Europe/Lisbon.rb +259 -250
  648. data/lib/tzinfo/definitions/Europe/Ljubljana.rb +11 -11
  649. data/lib/tzinfo/definitions/Europe/London.rb +279 -271
  650. data/lib/tzinfo/definitions/Europe/Luxembourg.rb +221 -211
  651. data/lib/tzinfo/definitions/Europe/Madrid.rb +202 -193
  652. data/lib/tzinfo/definitions/Europe/Malta.rb +207 -198
  653. data/lib/tzinfo/definitions/Europe/Mariehamn.rb +11 -11
  654. data/lib/tzinfo/definitions/Europe/Minsk.rb +159 -147
  655. data/lib/tzinfo/definitions/Europe/Monaco.rb +223 -214
  656. data/lib/tzinfo/definitions/Europe/Moscow.rb +168 -158
  657. data/lib/tzinfo/definitions/Europe/Nicosia.rb +11 -11
  658. data/lib/tzinfo/definitions/Europe/Oslo.rb +179 -169
  659. data/lib/tzinfo/definitions/Europe/Paris.rb +222 -212
  660. data/lib/tzinfo/definitions/Europe/Prague.rb +180 -170
  661. data/lib/tzinfo/definitions/Europe/Riga.rb +164 -156
  662. data/lib/tzinfo/definitions/Europe/Rome.rb +208 -200
  663. data/lib/tzinfo/definitions/Europe/Samara.rb +155 -145
  664. data/lib/tzinfo/definitions/Europe/San_Marino.rb +11 -11
  665. data/lib/tzinfo/definitions/Europe/Sarajevo.rb +11 -11
  666. data/lib/tzinfo/definitions/Europe/Simferopol.rb +159 -151
  667. data/lib/tzinfo/definitions/Europe/Skopje.rb +11 -11
  668. data/lib/tzinfo/definitions/Europe/Sofia.rb +164 -157
  669. data/lib/tzinfo/definitions/Europe/Stockholm.rb +158 -149
  670. data/lib/tzinfo/definitions/Europe/Tallinn.rb +161 -152
  671. data/lib/tzinfo/definitions/Europe/Tirane.rb +171 -162
  672. data/lib/tzinfo/definitions/Europe/Tiraspol.rb +11 -11
  673. data/lib/tzinfo/definitions/Europe/Uzhgorod.rb +158 -153
  674. data/lib/tzinfo/definitions/Europe/Vaduz.rb +153 -144
  675. data/lib/tzinfo/definitions/Europe/Vatican.rb +11 -11
  676. data/lib/tzinfo/definitions/Europe/Vienna.rb +177 -170
  677. data/lib/tzinfo/definitions/Europe/Vilnius.rb +158 -148
  678. data/lib/tzinfo/definitions/Europe/Warsaw.rb +203 -195
  679. data/lib/tzinfo/definitions/Europe/Zagreb.rb +11 -11
  680. data/lib/tzinfo/definitions/Europe/Zaporozhye.rb +160 -150
  681. data/lib/tzinfo/definitions/Europe/Zurich.rb +160 -151
  682. data/lib/tzinfo/definitions/GB.rb +9 -9
  683. data/lib/tzinfo/definitions/GB__m__Eire.rb +9 -9
  684. data/lib/tzinfo/definitions/GMT.rb +9 -9
  685. data/lib/tzinfo/definitions/GMT0.rb +9 -9
  686. data/lib/tzinfo/definitions/GMT__m__0.rb +9 -9
  687. data/lib/tzinfo/definitions/GMT__p__0.rb +9 -9
  688. data/lib/tzinfo/definitions/Greenwich.rb +9 -9
  689. data/lib/tzinfo/definitions/HST.rb +10 -10
  690. data/lib/tzinfo/definitions/Hongkong.rb +9 -9
  691. data/lib/tzinfo/definitions/Iceland.rb +9 -9
  692. data/lib/tzinfo/definitions/Indian/Antananarivo.rb +15 -15
  693. data/lib/tzinfo/definitions/Indian/Chagos.rb +14 -14
  694. data/lib/tzinfo/definitions/Indian/Christmas.rb +13 -13
  695. data/lib/tzinfo/definitions/Indian/Cocos.rb +13 -13
  696. data/lib/tzinfo/definitions/Indian/Comoro.rb +13 -13
  697. data/lib/tzinfo/definitions/Indian/Kerguelen.rb +13 -13
  698. data/lib/tzinfo/definitions/Indian/Mahe.rb +13 -13
  699. data/lib/tzinfo/definitions/Indian/Maldives.rb +14 -14
  700. data/lib/tzinfo/definitions/Indian/Mauritius.rb +13 -13
  701. data/lib/tzinfo/definitions/Indian/Mayotte.rb +13 -13
  702. data/lib/tzinfo/definitions/Indian/Reunion.rb +13 -13
  703. data/lib/tzinfo/definitions/Iran.rb +9 -9
  704. data/lib/tzinfo/definitions/Israel.rb +9 -9
  705. data/lib/tzinfo/definitions/Jamaica.rb +9 -9
  706. data/lib/tzinfo/definitions/Japan.rb +9 -9
  707. data/lib/tzinfo/definitions/Kwajalein.rb +9 -9
  708. data/lib/tzinfo/definitions/Libya.rb +9 -9
  709. data/lib/tzinfo/definitions/MET.rb +170 -160
  710. data/lib/tzinfo/definitions/MST.rb +10 -10
  711. data/lib/tzinfo/definitions/MST7MDT.rb +185 -174
  712. data/lib/tzinfo/definitions/Mexico/BajaNorte.rb +11 -11
  713. data/lib/tzinfo/definitions/Mexico/BajaSur.rb +11 -11
  714. data/lib/tzinfo/definitions/Mexico/General.rb +11 -11
  715. data/lib/tzinfo/definitions/Mideast/Riyadh87.rb +11 -0
  716. data/lib/tzinfo/definitions/Mideast/Riyadh88.rb +11 -0
  717. data/lib/tzinfo/definitions/Mideast/Riyadh89.rb +11 -0
  718. data/lib/tzinfo/definitions/NZ.rb +9 -9
  719. data/lib/tzinfo/definitions/NZ__m__CHAT.rb +9 -9
  720. data/lib/tzinfo/definitions/Navajo.rb +9 -9
  721. data/lib/tzinfo/definitions/PRC.rb +9 -9
  722. data/lib/tzinfo/definitions/PST8PDT.rb +185 -174
  723. data/lib/tzinfo/definitions/Pacific/Apia.rb +15 -15
  724. data/lib/tzinfo/definitions/Pacific/Auckland.rb +192 -184
  725. data/lib/tzinfo/definitions/Pacific/Chatham.rb +165 -156
  726. data/lib/tzinfo/definitions/Pacific/Easter.rb +182 -174
  727. data/lib/tzinfo/definitions/Pacific/Efate.rb +33 -33
  728. data/lib/tzinfo/definitions/Pacific/Enderbury.rb +15 -15
  729. data/lib/tzinfo/definitions/Pacific/Fakaofo.rb +13 -13
  730. data/lib/tzinfo/definitions/Pacific/Fiji.rb +17 -17
  731. data/lib/tzinfo/definitions/Pacific/Funafuti.rb +13 -13
  732. data/lib/tzinfo/definitions/Pacific/Galapagos.rb +14 -14
  733. data/lib/tzinfo/definitions/Pacific/Gambier.rb +13 -13
  734. data/lib/tzinfo/definitions/Pacific/Guadalcanal.rb +13 -13
  735. data/lib/tzinfo/definitions/Pacific/Guam.rb +15 -15
  736. data/lib/tzinfo/definitions/Pacific/Honolulu.rb +19 -17
  737. data/lib/tzinfo/definitions/Pacific/Johnston.rb +12 -12
  738. data/lib/tzinfo/definitions/Pacific/Kiritimati.rb +15 -15
  739. data/lib/tzinfo/definitions/Pacific/Kosrae.rb +15 -15
  740. data/lib/tzinfo/definitions/Pacific/Kwajalein.rb +15 -15
  741. data/lib/tzinfo/definitions/Pacific/Majuro.rb +14 -14
  742. data/lib/tzinfo/definitions/Pacific/Marquesas.rb +13 -13
  743. data/lib/tzinfo/definitions/Pacific/Midway.rb +17 -17
  744. data/lib/tzinfo/definitions/Pacific/Nauru.rb +16 -16
  745. data/lib/tzinfo/definitions/Pacific/Niue.rb +15 -15
  746. data/lib/tzinfo/definitions/Pacific/Norfolk.rb +14 -14
  747. data/lib/tzinfo/definitions/Pacific/Noumea.rb +19 -19
  748. data/lib/tzinfo/definitions/Pacific/Pago_Pago.rb +17 -17
  749. data/lib/tzinfo/definitions/Pacific/Palau.rb +13 -13
  750. data/lib/tzinfo/definitions/Pacific/Pitcairn.rb +14 -14
  751. data/lib/tzinfo/definitions/Pacific/Ponape.rb +13 -13
  752. data/lib/tzinfo/definitions/Pacific/Port_Moresby.rb +14 -14
  753. data/lib/tzinfo/definitions/Pacific/Rarotonga.rb +39 -39
  754. data/lib/tzinfo/definitions/Pacific/Saipan.rb +16 -16
  755. data/lib/tzinfo/definitions/Pacific/Samoa.rb +11 -11
  756. data/lib/tzinfo/definitions/Pacific/Tahiti.rb +13 -13
  757. data/lib/tzinfo/definitions/Pacific/Tarawa.rb +13 -13
  758. data/lib/tzinfo/definitions/Pacific/Tongatapu.rb +20 -21
  759. data/lib/tzinfo/definitions/Pacific/Truk.rb +13 -13
  760. data/lib/tzinfo/definitions/Pacific/Wake.rb +13 -13
  761. data/lib/tzinfo/definitions/Pacific/Wallis.rb +13 -13
  762. data/lib/tzinfo/definitions/Pacific/Yap.rb +11 -11
  763. data/lib/tzinfo/definitions/Poland.rb +9 -9
  764. data/lib/tzinfo/definitions/Portugal.rb +9 -9
  765. data/lib/tzinfo/definitions/ROC.rb +9 -9
  766. data/lib/tzinfo/definitions/ROK.rb +9 -9
  767. data/lib/tzinfo/definitions/Singapore.rb +9 -9
  768. data/lib/tzinfo/definitions/Turkey.rb +9 -9
  769. data/lib/tzinfo/definitions/UCT.rb +9 -9
  770. data/lib/tzinfo/definitions/US/Alaska.rb +11 -11
  771. data/lib/tzinfo/definitions/US/Aleutian.rb +11 -11
  772. data/lib/tzinfo/definitions/US/Arizona.rb +11 -11
  773. data/lib/tzinfo/definitions/US/Central.rb +11 -11
  774. data/lib/tzinfo/definitions/US/East__m__Indiana.rb +11 -11
  775. data/lib/tzinfo/definitions/US/Eastern.rb +11 -11
  776. data/lib/tzinfo/definitions/US/Hawaii.rb +11 -11
  777. data/lib/tzinfo/definitions/US/Indiana__m__Starke.rb +11 -11
  778. data/lib/tzinfo/definitions/US/Michigan.rb +11 -11
  779. data/lib/tzinfo/definitions/US/Mountain.rb +11 -11
  780. data/lib/tzinfo/definitions/US/Pacific.rb +11 -11
  781. data/lib/tzinfo/definitions/US/Pacific__m__New.rb +11 -11
  782. data/lib/tzinfo/definitions/US/Samoa.rb +11 -11
  783. data/lib/tzinfo/definitions/UTC.rb +9 -9
  784. data/lib/tzinfo/definitions/Universal.rb +9 -9
  785. data/lib/tzinfo/definitions/WET.rb +158 -148
  786. data/lib/tzinfo/definitions/W__m__SU.rb +9 -9
  787. data/lib/tzinfo/definitions/Zulu.rb +9 -9
  788. data/lib/tzinfo/offset_rationals.rb +95 -0
  789. data/lib/tzinfo/time_or_datetime.rb +269 -0
  790. data/lib/tzinfo/timezone.rb +25 -44
  791. data/lib/tzinfo/timezone_period.rb +54 -87
  792. data/lib/tzinfo/timezone_period_list.rb +7 -2
  793. data/lib/tzinfo/tzdataparser.rb +378 -325
  794. data/test/tc_offset_rationals.rb +25 -0
  795. data/test/tc_time_or_datetime.rb +386 -0
  796. data/test/tc_timezone.rb +43 -7
  797. data/test/tc_timezone_london.rb +61 -1
  798. data/test/tc_timezone_melbourne.rb +61 -1
  799. data/test/tc_timezone_new_york.rb +61 -1
  800. data/test/tc_timezone_period.rb +152 -65
  801. data/test/ts_all.rb +4 -0
  802. metadata +14 -2
@@ -1,9 +1,9 @@
1
- require 'tzinfo/timezone'
2
- require 'tzinfo/definitions/Europe/Moscow'
3
- module TZInfo
4
- module Definitions #:nodoc:
5
- class W__m__SU < Definitions::Europe::Moscow #:nodoc:
6
- set_identifier('W-SU')
7
- end
8
- end
9
- end
1
+ require 'tzinfo/timezone'
2
+ require 'tzinfo/definitions/Europe/Moscow'
3
+ module TZInfo
4
+ module Definitions #:nodoc:
5
+ class W__m__SU < Definitions::Europe::Moscow #:nodoc:
6
+ set_identifier('W-SU')
7
+ end
8
+ end
9
+ end
@@ -1,9 +1,9 @@
1
- require 'tzinfo/timezone'
2
- require 'tzinfo/definitions/Etc/UTC'
3
- module TZInfo
4
- module Definitions #:nodoc:
5
- class Zulu < Definitions::Etc::UTC #:nodoc:
6
- set_identifier('Zulu')
7
- end
8
- end
9
- end
1
+ require 'tzinfo/timezone'
2
+ require 'tzinfo/definitions/Etc/UTC'
3
+ module TZInfo
4
+ module Definitions #:nodoc:
5
+ class Zulu < Definitions::Etc::UTC #:nodoc:
6
+ set_identifier('Zulu')
7
+ end
8
+ end
9
+ end
@@ -0,0 +1,95 @@
1
+ #--
2
+ # Copyright (c) 2006 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
+ module TZInfo
24
+
25
+ # Provides a method for getting Rationals for a timezone offset in seconds.
26
+ # Pre-reduced rationals are returned for all the half-hour intervals between
27
+ # -14 and +14 hours to avoid having to call gcd at runtime.
28
+ module OffsetRationals #:nodoc:
29
+ @@rational_cache = {
30
+ -50400 => Rational.new!(-7,12),
31
+ -48600 => Rational.new!(-9,16),
32
+ -46800 => Rational.new!(-13,24),
33
+ -45000 => Rational.new!(-25,48),
34
+ -43200 => Rational.new!(-1,2),
35
+ -41400 => Rational.new!(-23,48),
36
+ -39600 => Rational.new!(-11,24),
37
+ -37800 => Rational.new!(-7,16),
38
+ -36000 => Rational.new!(-5,12),
39
+ -34200 => Rational.new!(-19,48),
40
+ -32400 => Rational.new!(-3,8),
41
+ -30600 => Rational.new!(-17,48),
42
+ -28800 => Rational.new!(-1,3),
43
+ -27000 => Rational.new!(-5,16),
44
+ -25200 => Rational.new!(-7,24),
45
+ -23400 => Rational.new!(-13,48),
46
+ -21600 => Rational.new!(-1,4),
47
+ -19800 => Rational.new!(-11,48),
48
+ -18000 => Rational.new!(-5,24),
49
+ -16200 => Rational.new!(-3,16),
50
+ -14400 => Rational.new!(-1,6),
51
+ -12600 => Rational.new!(-7,48),
52
+ -10800 => Rational.new!(-1,8),
53
+ -9000 => Rational.new!(-5,48),
54
+ -7200 => Rational.new!(-1,12),
55
+ -5400 => Rational.new!(-1,16),
56
+ -3600 => Rational.new!(-1,24),
57
+ -1800 => Rational.new!(-1,48),
58
+ 0 => Rational.new!(0,1),
59
+ 1800 => Rational.new!(1,48),
60
+ 3600 => Rational.new!(1,24),
61
+ 5400 => Rational.new!(1,16),
62
+ 7200 => Rational.new!(1,12),
63
+ 9000 => Rational.new!(5,48),
64
+ 10800 => Rational.new!(1,8),
65
+ 12600 => Rational.new!(7,48),
66
+ 14400 => Rational.new!(1,6),
67
+ 16200 => Rational.new!(3,16),
68
+ 18000 => Rational.new!(5,24),
69
+ 19800 => Rational.new!(11,48),
70
+ 21600 => Rational.new!(1,4),
71
+ 23400 => Rational.new!(13,48),
72
+ 25200 => Rational.new!(7,24),
73
+ 27000 => Rational.new!(5,16),
74
+ 28800 => Rational.new!(1,3),
75
+ 30600 => Rational.new!(17,48),
76
+ 32400 => Rational.new!(3,8),
77
+ 34200 => Rational.new!(19,48),
78
+ 36000 => Rational.new!(5,12),
79
+ 37800 => Rational.new!(7,16),
80
+ 39600 => Rational.new!(11,24),
81
+ 41400 => Rational.new!(23,48),
82
+ 43200 => Rational.new!(1,2),
83
+ 45000 => Rational.new!(25,48),
84
+ 46800 => Rational.new!(13,24),
85
+ 48600 => Rational.new!(9,16),
86
+ 50400 => Rational.new!(7,12)}
87
+
88
+ # Returns a Rational expressing the fraction of a day that offset in
89
+ # seconds represents (i.e. equivalent to Rational(offset, 86400)).
90
+ def rational_for_offset(offset)
91
+ @@rational_cache[offset] || Rational(offset, 86400)
92
+ end
93
+ module_function :rational_for_offset
94
+ end
95
+ end
@@ -0,0 +1,269 @@
1
+ #--
2
+ # Copyright (c) 2006 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'
24
+ require 'time'
25
+ require 'tzinfo/offset_rationals'
26
+
27
+ module TZInfo
28
+ # Used by TZInfo internally to represent either a Time, DateTime or integer
29
+ # timestamp (seconds since 1970-01-01 00:00:00).
30
+ class TimeOrDateTime #:nodoc:
31
+ include Comparable
32
+
33
+ # Constructs a new TimeOrDateTime. timeOrDateTime can be a Time, DateTime
34
+ # or an integer. If using a Time, any time zone information is ignored.
35
+ def initialize(timeOrDateTime)
36
+ @time = nil
37
+ @datetime = nil
38
+ @timestamp = nil
39
+
40
+ if timeOrDateTime.is_a?(Time)
41
+ @time = timeOrDateTime
42
+ @time = Time.utc(@time.year, @time.mon, @time.mday, @time.hour, @time.min, @time.sec) unless @time.zone == 'UTC'
43
+ @orig = @time
44
+ elsif timeOrDateTime.is_a?(DateTime)
45
+ @datetime = timeOrDateTime
46
+ @orig = @datetime
47
+ else
48
+ @timestamp = timeOrDateTime.to_i
49
+ @orig = @timestamp
50
+ end
51
+ end
52
+
53
+ # Returns the time as a Time.
54
+ def to_time
55
+ if @time.nil?
56
+ if !@timestamp.nil?
57
+ @time = Time.at(@timestamp).utc
58
+ else
59
+ @time = Time.utc(year, mon, mday, hour, min, sec)
60
+ end
61
+ end
62
+
63
+ @time
64
+ end
65
+
66
+ # Returns the time as a DateTime.
67
+ def to_datetime
68
+ if @datetime.nil?
69
+ @datetime = DateTime.new(year, mon, mday, hour, min, sec)
70
+ end
71
+
72
+ @datetime
73
+ end
74
+
75
+ # Returns the time as an integer timestamp.
76
+ def to_i
77
+ if @timestamp.nil?
78
+ @timestamp = to_time.to_i
79
+ end
80
+
81
+ @timestamp
82
+ end
83
+
84
+ # Returns the time as the original time passed to new.
85
+ def to_orig
86
+ @orig
87
+ end
88
+
89
+ # Returns a string representation of the TimeOrDateTime.
90
+ def to_s
91
+ if @orig.is_a?(Time)
92
+ "Time: #{@orig.to_s}"
93
+ elsif @orig.is_a?(DateTime)
94
+ "DateTime: #{@orig.to_s}"
95
+ else
96
+ "Timestamp: #{@orig.to_s}"
97
+ end
98
+ end
99
+
100
+ # Returns the year.
101
+ def year
102
+ if !@time.nil?
103
+ @time.year
104
+ elsif !@datetime.nil?
105
+ @datetime.year
106
+ else
107
+ to_time.year
108
+ end
109
+ end
110
+
111
+ # Returns the month of the year (1..12).
112
+ def mon
113
+ if !@time.nil?
114
+ @time.mon
115
+ elsif !@datetime.nil?
116
+ @datetime.mon
117
+ else
118
+ to_time.mon
119
+ end
120
+ end
121
+ alias :month :mon
122
+
123
+ # Returns the day of the month (1..n).
124
+ def mday
125
+ if !@time.nil?
126
+ @time.mday
127
+ elsif !@datetime.nil?
128
+ @datetime.mday
129
+ else
130
+ to_time.mday
131
+ end
132
+ end
133
+ alias :day :mday
134
+
135
+ # Returns the hour of the day (0..23).
136
+ def hour
137
+ if !@time.nil?
138
+ @time.hour
139
+ elsif !@datetime.nil?
140
+ @datetime.hour
141
+ else
142
+ to_time.hour
143
+ end
144
+ end
145
+
146
+ # Returns the minute of the hour (0..59).
147
+ def min
148
+ if !@time.nil?
149
+ @time.min
150
+ elsif !@datetime.nil?
151
+ @datetime.min
152
+ else
153
+ to_time.min
154
+ end
155
+ end
156
+
157
+ # Returns the second of the minute (0..60). (60 for a leap second).
158
+ def sec
159
+ if !@time.nil?
160
+ @time.sec
161
+ elsif !@datetime.nil?
162
+ @datetime.sec
163
+ else
164
+ to_time.sec
165
+ end
166
+ end
167
+
168
+ # Compares this TimeOrDateTime with another Time, DateTime, integer
169
+ # timestamp or TimeOrDateTime. Returns -1, 0 or +1 depending whether the
170
+ # receiver is less than, equal to, or greater than timeOrDateTime.
171
+ #
172
+ # Milliseconds and smaller units are ignored in the comparison.
173
+ def <=>(timeOrDateTime)
174
+ if timeOrDateTime.is_a?(TimeOrDateTime)
175
+ self <=> timeOrDateTime.orig
176
+ elsif @orig.is_a?(DateTime) || timeOrDateTime.is_a?(DateTime)
177
+ # If either is a DateTime, assume it is there for a reason
178
+ # (i.e. for range).
179
+ to_datetime <=> TimeOrDateTime.wrap(timeOrDateTime).to_datetime
180
+ elsif timeOrDateTime.is_a?(Time)
181
+ to_time <=> timeOrDateTime
182
+ else
183
+ to_i <=> timeOrDateTime.to_i
184
+ end
185
+ end
186
+
187
+ # Adds a number of seconds to the TimeOrDateTime. Returns a new
188
+ # TimeOrDateTime, preserving what the original constructed type was.
189
+ # If the original type is a Time and the resulting calculation goes out of
190
+ # range for Times, then an exception will be raised by the Time class.
191
+ def +(seconds)
192
+ if seconds == 0
193
+ self
194
+ else
195
+ if @orig.is_a?(DateTime)
196
+ TimeOrDateTime.new(@orig + OffsetRationals.rational_for_offset(seconds))
197
+ else
198
+ # + defined for Time and integer timestamps
199
+ TimeOrDateTime.new(@orig + seconds)
200
+ end
201
+ end
202
+ end
203
+
204
+ # Subtracts a number of seconds from the TimeOrDateTime. Returns a new
205
+ # TimeOrDateTime, preserving what the original constructed type was.
206
+ # If the original type is a Time and the resulting calculation goes out of
207
+ # range for Times, then an exception will be raised by the Time class.
208
+ def -(seconds)
209
+ self + (-seconds)
210
+ end
211
+
212
+ # Similar to the + operator, but for cases where adding would cause a
213
+ # timestamp or time to go out of the allowed range, converts to a DateTime
214
+ # based TimeOrDateTime.
215
+ def add_with_convert(seconds)
216
+ if seconds == 0
217
+ self
218
+ else
219
+ if @orig.is_a?(DateTime)
220
+ TimeOrDateTime.new(@orig + OffsetRationals.rational_for_offset(seconds))
221
+ else
222
+ # A Time or timestamp.
223
+ result = to_i + seconds
224
+
225
+ if result < 0 || result > 2147483647
226
+ result = TimeOrDateTime.new(to_datetime + OffsetRationals.rational_for_offset(seconds))
227
+ else
228
+ result = TimeOrDateTime.new(@orig + seconds)
229
+ end
230
+ end
231
+ end
232
+ end
233
+
234
+ # If no block is given, returns a TimeOrDateTime wrapping the given
235
+ # timeOrDateTime. If a block is specified, a TimeOrDateTime is constructed
236
+ # and passed to the block. The result of the block must be a TimeOrDateTime.
237
+ # to_orig will be called on the result and the result of to_orig will be
238
+ # returned.
239
+ #
240
+ # timeOrDateTime can be a Time, DateTime, integer timestamp or TimeOrDateTime.
241
+ # If a TimeOrDateTime is passed in, no new TimeOrDateTime will be constructed,
242
+ # the passed in value will be used.
243
+ def self.wrap(timeOrDateTime)
244
+ t = timeOrDateTime.is_a?(TimeOrDateTime) ? timeOrDateTime : TimeOrDateTime.new(timeOrDateTime)
245
+
246
+ if block_given?
247
+ t = yield t
248
+
249
+ if timeOrDateTime.is_a?(TimeOrDateTime)
250
+ t
251
+ elsif timeOrDateTime.is_a?(Time)
252
+ t.to_time
253
+ elsif timeOrDateTime.is_a?(DateTime)
254
+ t.to_datetime
255
+ else
256
+ t.to_i
257
+ end
258
+ else
259
+ t
260
+ end
261
+ end
262
+
263
+ protected
264
+ # The time in the format it was originally constructed.
265
+ def orig
266
+ @orig
267
+ end
268
+ end
269
+ end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2005 Philip Ross
2
+ # Copyright (c) 2005-2006 Philip Ross
3
3
  #
4
4
  # Permission is hereby granted, free of charge, to any person obtaining a copy
5
5
  # of this software and associated documentation files (the "Software"), to deal
@@ -22,6 +22,7 @@
22
22
 
23
23
  require 'date'
24
24
  require 'tzinfo/country'
25
+ require 'tzinfo/time_or_datetime'
25
26
  require 'tzinfo/timezone_period'
26
27
  require 'tzinfo/timezone_period_list'
27
28
 
@@ -45,12 +46,16 @@ module TZInfo
45
46
 
46
47
  # Timezone is the base class of all timezones. It provides a factory method
47
48
  # get to access timezones by identifier. Once a specific Timezone has been
48
- # retrieved, DateTimes and Times can be converted between the UTC and the
49
- # local time for the zone. For example:
49
+ # retrieved, DateTimes, Times and timestamps can be converted between the UTC
50
+ # and the local time for the zone. For example:
50
51
  #
51
52
  # tz = TZInfo::Timezone.get('America/New_York')
52
53
  # puts tz.utc_to_local(DateTime.new(2005,8,29,15,35,0)).to_s
53
54
  # puts tz.local_to_utc(Time.utc(2005,8,29,11,35,0)).to_s
55
+ # puts tz.utc_to_local(1125315300).to_s
56
+ #
57
+ # Each time conversion method returns an object of the same type it was
58
+ # passed.
54
59
  #
55
60
  # The timezone information all comes from the tz database
56
61
  # (see http://www.twinsun.com/tz/tz-link.htm)
@@ -204,18 +209,18 @@ module TZInfo
204
209
  end
205
210
 
206
211
  # Returns the TimezonePeriod for the given UTC time. utc can either be
207
- # a DateTime or a Time. Any timezone information in utc is ignored (it is
208
- # treated as a UTC time).
212
+ # a DateTime, Time or integer timestamp (Time.to_i). Any timezone
213
+ # information in utc is ignored (it is treated as a UTC time).
209
214
  #
210
215
  # If no TimezonePeriod could be found, PeriodNotFound is raised.
211
- def period_for_utc(utc)
212
- utc = as_datetime(utc)
216
+ def period_for_utc(utc)
213
217
  periods.period_for_utc(utc)
214
218
  end
215
219
 
216
220
  # Returns the TimezonePeriod for the given local time. local can either be
217
- # a DateTime or a Time. Any timezone information in local is ignored (it is
218
- # treated as a time in the current timezone).
221
+ # a DateTime, Time or integer timestamp (Time.to_i). Any timezone
222
+ # information in local is ignored (it is treated as a time in the current
223
+ # timezone).
219
224
  #
220
225
  # Warning: There are local times that have no equivalent UTC times (e.g.
221
226
  # in the transition from standard time to daylight savings time). There are
@@ -246,8 +251,7 @@ module TZInfo
246
251
  # array of the periods that need to be resolved. The block can select and
247
252
  # return a single period or return nil or an empty array
248
253
  # to cause an AmbiguousTime exception to be raised.
249
- def period_for_local(local, dst = nil)
250
- local = as_datetime(local)
254
+ def period_for_local(local, dst = nil)
251
255
  results = periods.periods_for_local(local)
252
256
 
253
257
  # by this point, results must contain at least one period
@@ -282,17 +286,19 @@ module TZInfo
282
286
  end
283
287
 
284
288
  # Converts a time in UTC to the local timezone. utc can either be
285
- # a DateTime or a Time. The returned time has the same type as utc.
286
- # Any timezone information in utc is ignored (it is treated as a UTC time).
289
+ # a DateTime, Time or timestamp (Time.to_i). The returned time has the same
290
+ # type as utc. Any timezone information in utc is ignored (it is treated as
291
+ # a UTC time).
287
292
  def utc_to_local(utc)
288
- run_on_datetime(utc) {|utc|
293
+ TimeOrDateTime.wrap(utc) {|utc|
289
294
  period_for_utc(utc).to_local(utc)
290
295
  }
291
296
  end
292
297
 
293
298
  # Converts a time in the local timezone to UTC. local can either be
294
- # a DateTime or a Time. The returned time has the same type as local.
295
- # Any timezone information in local is ignored (it is treated as a local time).
299
+ # a DateTime, Time or timestamp (Time.to_i). The returned time has the same
300
+ # type as local. Any timezone information in local is ignored (it is treated
301
+ # as a local time).
296
302
  #
297
303
  # Warning: There are local times that have no equivalent UTC times (e.g.
298
304
  # in the transition from standard time to daylight savings time). There are
@@ -323,7 +329,7 @@ module TZInfo
323
329
  # single period to use to convert the time or return nil or an empty array
324
330
  # to cause an AmbiguousTime exception to be raised.
325
331
  def local_to_utc(local, dst = nil)
326
- run_on_datetime(local) {|local|
332
+ TimeOrDateTime.wrap(local) {|local|
327
333
  if block_given?
328
334
  period = period_for_local(local, dst) {|periods| yield periods }
329
335
  else
@@ -348,7 +354,8 @@ module TZInfo
348
354
  # is the time, the second element is the period.
349
355
  def current_period_and_time
350
356
  utc = Time.now.utc
351
- [utc_to_local(utc), period_for_utc(utc)]
357
+ period = period_for_utc(utc)
358
+ [period.to_local(utc), period]
352
359
  end
353
360
 
354
361
  alias :current_time_and_period :current_period_and_time
@@ -401,32 +408,6 @@ module TZInfo
401
408
  end
402
409
  CODE
403
410
  end
404
-
405
- private
406
- # If called with a Time, returns an equivalent DateTime; otherwise returns
407
- # the datetime paramter.
408
- def as_datetime(datetime)
409
- if datetime.instance_of?(Time)
410
- DateTime.new(datetime.year, datetime.mon, datetime.mday, datetime.hour, datetime.min, datetime.sec)
411
- else
412
- datetime
413
- end
414
- end
415
-
416
- # Executes a block with a DateTime. If datetime is a Time it will be
417
- # converted to a DateTime before yielding to the block and the result of
418
- # the block will be converted back to a Time.
419
- def run_on_datetime(datetime)
420
- if datetime.instance_of?(Time)
421
- datetime = DateTime.new(datetime.year, datetime.mon, datetime.mday, datetime.hour, datetime.min, datetime.sec)
422
- result = yield datetime
423
-
424
- # not necessarily utc, but pretend it is
425
- Time.utc(result.year, result.mon, result.mday, result.hour, result.min, result.sec)
426
- else
427
- yield datetime
428
- end
429
- end
430
411
  end
431
412
 
432
413
  # A proxy class representing a timezone with a given identifier. It can be