jstz.js 42 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433
  1. (function (root) {/*global exports, Intl*/
  2. /**
  3. * This script gives you the zone info key representing your device's time zone setting.
  4. *
  5. * @name jsTimezoneDetect
  6. * @version 1.0.6
  7. * @author Jon Nylander
  8. * @license MIT License - https://bitbucket.org/pellepim/jstimezonedetect/src/default/LICENCE.txt
  9. *
  10. * For usage and examples, visit:
  11. * http://pellepim.bitbucket.org/jstz/
  12. *
  13. * Copyright (c) Jon Nylander
  14. */
  15. /**
  16. * Namespace to hold all the code for timezone detection.
  17. */
  18. var jstz = (function () {
  19. 'use strict';
  20. var HEMISPHERE_SOUTH = 's',
  21. consts = {
  22. DAY: 86400000,
  23. HOUR: 3600000,
  24. MINUTE: 60000,
  25. SECOND: 1000,
  26. BASELINE_YEAR: 2014,
  27. MAX_SCORE: 864000000, // 10 days
  28. AMBIGUITIES: {
  29. 'America/Denver': ['America/Mazatlan'],
  30. 'Europe/London': ['Africa/Casablanca'],
  31. 'America/Chicago': ['America/Mexico_City'],
  32. 'America/Asuncion': ['America/Campo_Grande', 'America/Santiago'],
  33. 'America/Montevideo': ['America/Sao_Paulo', 'America/Santiago'],
  34. // Europe/Minsk should not be in this list... but Windows.
  35. 'Asia/Beirut': ['Asia/Amman', 'Asia/Jerusalem', 'Europe/Helsinki', 'Asia/Damascus', 'Africa/Cairo', 'Asia/Gaza', 'Europe/Minsk'],
  36. 'Pacific/Auckland': ['Pacific/Fiji'],
  37. 'America/Los_Angeles': ['America/Santa_Isabel'],
  38. 'America/New_York': ['America/Havana'],
  39. 'America/Halifax': ['America/Goose_Bay'],
  40. 'America/Godthab': ['America/Miquelon'],
  41. 'Asia/Dubai': ['Asia/Yerevan'],
  42. 'Asia/Jakarta': ['Asia/Krasnoyarsk'],
  43. 'Asia/Shanghai': ['Asia/Irkutsk', 'Australia/Perth'],
  44. 'Australia/Sydney': ['Australia/Lord_Howe'],
  45. 'Asia/Tokyo': ['Asia/Yakutsk'],
  46. 'Asia/Dhaka': ['Asia/Omsk'],
  47. // In the real world Yerevan is not ambigous for Baku... but Windows.
  48. 'Asia/Baku': ['Asia/Yerevan'],
  49. 'Australia/Brisbane': ['Asia/Vladivostok'],
  50. 'Pacific/Noumea': ['Asia/Vladivostok'],
  51. 'Pacific/Majuro': ['Asia/Kamchatka', 'Pacific/Fiji'],
  52. 'Pacific/Tongatapu': ['Pacific/Apia'],
  53. 'Asia/Baghdad': ['Europe/Minsk', 'Europe/Moscow'],
  54. 'Asia/Karachi': ['Asia/Yekaterinburg'],
  55. 'Africa/Johannesburg': ['Asia/Gaza', 'Africa/Cairo']
  56. }
  57. },
  58. /**
  59. * Gets the offset in minutes from UTC for a certain date.
  60. * @param {Date} date
  61. * @returns {Number}
  62. */
  63. get_date_offset = function get_date_offset(date) {
  64. var offset = -date.getTimezoneOffset();
  65. return (offset !== null ? offset : 0);
  66. },
  67. /**
  68. * This function does some basic calculations to create information about
  69. * the user's timezone. It uses REFERENCE_YEAR as a solid year for which
  70. * the script has been tested rather than depend on the year set by the
  71. * client device.
  72. *
  73. * Returns a key that can be used to do lookups in jstz.olson.timezones.
  74. * eg: "720,1,2".
  75. *
  76. * @returns {String}
  77. */
  78. lookup_key = function lookup_key() {
  79. var january_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 0, 2)),
  80. june_offset = get_date_offset(new Date(consts.BASELINE_YEAR, 5, 2)),
  81. diff = january_offset - june_offset;
  82. if (diff < 0) {
  83. return january_offset + ",1";
  84. } else if (diff > 0) {
  85. return june_offset + ",1," + HEMISPHERE_SOUTH;
  86. }
  87. return january_offset + ",0";
  88. },
  89. /**
  90. * Tries to get the time zone key directly from the operating system for those
  91. * environments that support the ECMAScript Internationalization API.
  92. */
  93. get_from_internationalization_api = function get_from_internationalization_api() {
  94. var format, timezone;
  95. if (typeof Intl === "undefined" || typeof Intl.DateTimeFormat === "undefined") {
  96. return;
  97. }
  98. format = Intl.DateTimeFormat();
  99. if (typeof format === "undefined" || typeof format.resolvedOptions === "undefined") {
  100. return;
  101. }
  102. timezone = format.resolvedOptions().timeZone;
  103. if (timezone && (timezone.indexOf("/") > -1 || timezone === 'UTC')) {
  104. return timezone;
  105. }
  106. },
  107. /**
  108. * Starting point for getting all the DST rules for a specific year
  109. * for the current timezone (as described by the client system).
  110. *
  111. * Returns an object with start and end attributes, or false if no
  112. * DST rules were found for the year.
  113. *
  114. * @param year
  115. * @returns {Object} || {Boolean}
  116. */
  117. dst_dates = function dst_dates(year) {
  118. var yearstart = new Date(year, 0, 1, 0, 0, 1, 0).getTime();
  119. var yearend = new Date(year, 12, 31, 23, 59, 59).getTime();
  120. var current = yearstart;
  121. var offset = (new Date(current)).getTimezoneOffset();
  122. var dst_start = null;
  123. var dst_end = null;
  124. while (current < yearend - 86400000) {
  125. var dateToCheck = new Date(current);
  126. var dateToCheckOffset = dateToCheck.getTimezoneOffset();
  127. if (dateToCheckOffset !== offset) {
  128. if (dateToCheckOffset < offset) {
  129. dst_start = dateToCheck;
  130. }
  131. if (dateToCheckOffset > offset) {
  132. dst_end = dateToCheck;
  133. }
  134. offset = dateToCheckOffset;
  135. }
  136. current += 86400000;
  137. }
  138. if (dst_start && dst_end) {
  139. return {
  140. s: find_dst_fold(dst_start).getTime(),
  141. e: find_dst_fold(dst_end).getTime()
  142. };
  143. }
  144. return false;
  145. },
  146. /**
  147. * Probably completely unnecessary function that recursively finds the
  148. * exact (to the second) time when a DST rule was changed.
  149. *
  150. * @param a_date - The candidate Date.
  151. * @param padding - integer specifying the padding to allow around the candidate
  152. * date for finding the fold.
  153. * @param iterator - integer specifying how many milliseconds to iterate while
  154. * searching for the fold.
  155. *
  156. * @returns {Date}
  157. */
  158. find_dst_fold = function find_dst_fold(a_date, padding, iterator) {
  159. if (typeof padding === 'undefined') {
  160. padding = consts.DAY;
  161. iterator = consts.HOUR;
  162. }
  163. var date_start = new Date(a_date.getTime() - padding).getTime();
  164. var date_end = a_date.getTime() + padding;
  165. var offset = new Date(date_start).getTimezoneOffset();
  166. var current = date_start;
  167. var dst_change = null;
  168. while (current < date_end - iterator) {
  169. var dateToCheck = new Date(current);
  170. var dateToCheckOffset = dateToCheck.getTimezoneOffset();
  171. if (dateToCheckOffset !== offset) {
  172. dst_change = dateToCheck;
  173. break;
  174. }
  175. current += iterator;
  176. }
  177. if (padding === consts.DAY) {
  178. return find_dst_fold(dst_change, consts.HOUR, consts.MINUTE);
  179. }
  180. if (padding === consts.HOUR) {
  181. return find_dst_fold(dst_change, consts.MINUTE, consts.SECOND);
  182. }
  183. return dst_change;
  184. },
  185. windows7_adaptations = function windows7_adaptions(rule_list, preliminary_timezone, score, sample) {
  186. if (score !== 'N/A') {
  187. return score;
  188. }
  189. if (preliminary_timezone === 'Asia/Beirut') {
  190. if (sample.name === 'Africa/Cairo') {
  191. if (rule_list[6].s === 1398376800000 && rule_list[6].e === 1411678800000) {
  192. return 0;
  193. }
  194. }
  195. if (sample.name === 'Asia/Jerusalem') {
  196. if (rule_list[6].s === 1395964800000 && rule_list[6].e === 1411858800000) {
  197. return 0;
  198. }
  199. }
  200. } else if (preliminary_timezone === 'America/Santiago') {
  201. if (sample.name === 'America/Asuncion') {
  202. if (rule_list[6].s === 1412481600000 && rule_list[6].e === 1397358000000) {
  203. return 0;
  204. }
  205. }
  206. if (sample.name === 'America/Campo_Grande') {
  207. if (rule_list[6].s === 1413691200000 && rule_list[6].e === 1392519600000) {
  208. return 0;
  209. }
  210. }
  211. } else if (preliminary_timezone === 'America/Montevideo') {
  212. if (sample.name === 'America/Sao_Paulo') {
  213. if (rule_list[6].s === 1413687600000 && rule_list[6].e === 1392516000000) {
  214. return 0;
  215. }
  216. }
  217. } else if (preliminary_timezone === 'Pacific/Auckland') {
  218. if (sample.name === 'Pacific/Fiji') {
  219. if (rule_list[6].s === 1414245600000 && rule_list[6].e === 1396101600000) {
  220. return 0;
  221. }
  222. }
  223. }
  224. return score;
  225. },
  226. /**
  227. * Takes the DST rules for the current timezone, and proceeds to find matches
  228. * in the jstz.olson.dst_rules.zones array.
  229. *
  230. * Compares samples to the current timezone on a scoring basis.
  231. *
  232. * Candidates are ruled immediately if either the candidate or the current zone
  233. * has a DST rule where the other does not.
  234. *
  235. * Candidates are ruled out immediately if the current zone has a rule that is
  236. * outside the DST scope of the candidate.
  237. *
  238. * Candidates are included for scoring if the current zones rules fall within the
  239. * span of the samples rules.
  240. *
  241. * Low score is best, the score is calculated by summing up the differences in DST
  242. * rules and if the consts.MAX_SCORE is overreached the candidate is ruled out.
  243. *
  244. * Yah follow? :)
  245. *
  246. * @param rule_list
  247. * @param preliminary_timezone
  248. * @returns {*}
  249. */
  250. best_dst_match = function best_dst_match(rule_list, preliminary_timezone) {
  251. var score_sample = function score_sample(sample) {
  252. var score = 0;
  253. for (var j = 0; j < rule_list.length; j++) {
  254. // Both sample and current time zone report DST during the year.
  255. if (!!sample.rules[j] && !!rule_list[j]) {
  256. // The current time zone's DST rules are inside the sample's. Include.
  257. if (rule_list[j].s >= sample.rules[j].s && rule_list[j].e <= sample.rules[j].e) {
  258. score = 0;
  259. score += Math.abs(rule_list[j].s - sample.rules[j].s);
  260. score += Math.abs(sample.rules[j].e - rule_list[j].e);
  261. // The current time zone's DST rules are outside the sample's. Discard.
  262. } else {
  263. score = 'N/A';
  264. break;
  265. }
  266. // The max score has been reached. Discard.
  267. if (score > consts.MAX_SCORE) {
  268. score = 'N/A';
  269. break;
  270. }
  271. }
  272. }
  273. score = windows7_adaptations(rule_list, preliminary_timezone, score, sample);
  274. return score;
  275. };
  276. var scoreboard = {};
  277. var dst_zones = jstz.olson.dst_rules.zones;
  278. var dst_zones_length = dst_zones.length;
  279. var ambiguities = consts.AMBIGUITIES[preliminary_timezone];
  280. for (var i = 0; i < dst_zones_length; i++) {
  281. var sample = dst_zones[i];
  282. var score = score_sample(dst_zones[i]);
  283. if (score !== 'N/A') {
  284. scoreboard[sample.name] = score;
  285. }
  286. }
  287. for (var tz in scoreboard) {
  288. if (scoreboard.hasOwnProperty(tz)) {
  289. for (var j = 0; j < ambiguities.length; j++) {
  290. if (ambiguities[j] === tz) {
  291. return tz;
  292. }
  293. }
  294. }
  295. }
  296. return preliminary_timezone;
  297. },
  298. /**
  299. * Takes the preliminary_timezone as detected by lookup_key().
  300. *
  301. * Builds up the current timezones DST rules for the years defined
  302. * in the jstz.olson.dst_rules.years array.
  303. *
  304. * If there are no DST occurences for those years, immediately returns
  305. * the preliminary timezone. Otherwise proceeds and tries to solve
  306. * ambiguities.
  307. *
  308. * @param preliminary_timezone
  309. * @returns {String} timezone_name
  310. */
  311. get_by_dst = function get_by_dst(preliminary_timezone) {
  312. var get_rules = function get_rules() {
  313. var rule_list = [];
  314. for (var i = 0; i < jstz.olson.dst_rules.years.length; i++) {
  315. var year_rules = dst_dates(jstz.olson.dst_rules.years[i]);
  316. rule_list.push(year_rules);
  317. }
  318. return rule_list;
  319. };
  320. var check_has_dst = function check_has_dst(rules) {
  321. for (var i = 0; i < rules.length; i++) {
  322. if (rules[i] !== false) {
  323. return true;
  324. }
  325. }
  326. return false;
  327. };
  328. var rules = get_rules();
  329. var has_dst = check_has_dst(rules);
  330. if (has_dst) {
  331. return best_dst_match(rules, preliminary_timezone);
  332. }
  333. return preliminary_timezone;
  334. },
  335. /**
  336. * Uses get_timezone_info() to formulate a key to use in the olson.timezones dictionary.
  337. *
  338. * Returns an object with one function ".name()"
  339. *
  340. * @returns Object
  341. */
  342. determine = function determine() {
  343. var preliminary_tz = get_from_internationalization_api();
  344. if (!preliminary_tz) {
  345. preliminary_tz = jstz.olson.timezones[lookup_key()];
  346. if (typeof consts.AMBIGUITIES[preliminary_tz] !== 'undefined') {
  347. preliminary_tz = get_by_dst(preliminary_tz);
  348. }
  349. }
  350. return {
  351. name: function () {
  352. return preliminary_tz;
  353. }
  354. };
  355. };
  356. return {
  357. determine: determine
  358. };
  359. }());
  360. jstz.olson = jstz.olson || {};
  361. /**
  362. * The keys in this dictionary are comma separated as such:
  363. *
  364. * First the offset compared to UTC time in minutes.
  365. *
  366. * Then a flag which is 0 if the timezone does not take daylight savings into account and 1 if it
  367. * does.
  368. *
  369. * Thirdly an optional 's' signifies that the timezone is in the southern hemisphere,
  370. * only interesting for timezones with DST.
  371. *
  372. * The mapped arrays is used for constructing the jstz.TimeZone object from within
  373. * jstz.determine();
  374. */
  375. jstz.olson.timezones = {
  376. '-720,0': 'Etc/GMT+12',
  377. '-660,0': 'Pacific/Pago_Pago',
  378. '-660,1,s': 'Pacific/Apia', // Why? Because windows... cry!
  379. '-600,1': 'America/Adak',
  380. '-600,0': 'Pacific/Honolulu',
  381. '-570,0': 'Pacific/Marquesas',
  382. '-540,0': 'Pacific/Gambier',
  383. '-540,1': 'America/Anchorage',
  384. '-480,1': 'America/Los_Angeles',
  385. '-480,0': 'Pacific/Pitcairn',
  386. '-420,0': 'America/Phoenix',
  387. '-420,1': 'America/Denver',
  388. '-360,0': 'America/Guatemala',
  389. '-360,1': 'America/Chicago',
  390. '-360,1,s': 'Pacific/Easter',
  391. '-300,0': 'America/Bogota',
  392. '-300,1': 'America/New_York',
  393. '-270,0': 'America/Caracas',
  394. '-240,1': 'America/Halifax',
  395. '-240,0': 'America/Santo_Domingo',
  396. '-240,1,s': 'America/Asuncion',
  397. '-210,1': 'America/St_Johns',
  398. '-180,1': 'America/Godthab',
  399. '-180,0': 'America/Argentina/Buenos_Aires',
  400. '-180,1,s': 'America/Montevideo',
  401. '-120,0': 'America/Noronha',
  402. '-120,1': 'America/Noronha',
  403. '-60,1': 'Atlantic/Azores',
  404. '-60,0': 'Atlantic/Cape_Verde',
  405. '0,0': 'UTC',
  406. '0,1': 'Europe/London',
  407. '60,1': 'Europe/Berlin',
  408. '60,0': 'Africa/Lagos',
  409. '60,1,s': 'Africa/Windhoek',
  410. '120,1': 'Asia/Beirut',
  411. '120,0': 'Africa/Johannesburg',
  412. '180,0': 'Asia/Baghdad',
  413. '180,1': 'Europe/Moscow',
  414. '210,1': 'Asia/Tehran',
  415. '240,0': 'Asia/Dubai',
  416. '240,1': 'Asia/Baku',
  417. '270,0': 'Asia/Kabul',
  418. '300,1': 'Asia/Yekaterinburg',
  419. '300,0': 'Asia/Karachi',
  420. '330,0': 'Asia/Kolkata',
  421. '345,0': 'Asia/Kathmandu',
  422. '360,0': 'Asia/Dhaka',
  423. '360,1': 'Asia/Omsk',
  424. '390,0': 'Asia/Rangoon',
  425. '420,1': 'Asia/Krasnoyarsk',
  426. '420,0': 'Asia/Jakarta',
  427. '480,0': 'Asia/Shanghai',
  428. '480,1': 'Asia/Irkutsk',
  429. '525,0': 'Australia/Eucla',
  430. '525,1,s': 'Australia/Eucla',
  431. '540,1': 'Asia/Yakutsk',
  432. '540,0': 'Asia/Tokyo',
  433. '570,0': 'Australia/Darwin',
  434. '570,1,s': 'Australia/Adelaide',
  435. '600,0': 'Australia/Brisbane',
  436. '600,1': 'Asia/Vladivostok',
  437. '600,1,s': 'Australia/Sydney',
  438. '630,1,s': 'Australia/Lord_Howe',
  439. '660,1': 'Asia/Kamchatka',
  440. '660,0': 'Pacific/Noumea',
  441. '690,0': 'Pacific/Norfolk',
  442. '720,1,s': 'Pacific/Auckland',
  443. '720,0': 'Pacific/Majuro',
  444. '765,1,s': 'Pacific/Chatham',
  445. '780,0': 'Pacific/Tongatapu',
  446. '780,1,s': 'Pacific/Apia',
  447. '840,0': 'Pacific/Kiritimati'
  448. };
  449. /* Build time: 2015-11-02 13:01:00Z Build by invoking python utilities/dst.py generate */
  450. jstz.olson.dst_rules = {
  451. "years": [
  452. 2008,
  453. 2009,
  454. 2010,
  455. 2011,
  456. 2012,
  457. 2013,
  458. 2014
  459. ],
  460. "zones": [
  461. {
  462. "name": "Africa/Cairo",
  463. "rules": [
  464. {
  465. "e": 1219957200000,
  466. "s": 1209074400000
  467. },
  468. {
  469. "e": 1250802000000,
  470. "s": 1240524000000
  471. },
  472. {
  473. "e": 1285880400000,
  474. "s": 1284069600000
  475. },
  476. false,
  477. false,
  478. false,
  479. {
  480. "e": 1411678800000,
  481. "s": 1406844000000
  482. }
  483. ]
  484. },
  485. {
  486. "name": "Africa/Casablanca",
  487. "rules": [
  488. {
  489. "e": 1220223600000,
  490. "s": 1212278400000
  491. },
  492. {
  493. "e": 1250809200000,
  494. "s": 1243814400000
  495. },
  496. {
  497. "e": 1281222000000,
  498. "s": 1272758400000
  499. },
  500. {
  501. "e": 1312066800000,
  502. "s": 1301788800000
  503. },
  504. {
  505. "e": 1348970400000,
  506. "s": 1345428000000
  507. },
  508. {
  509. "e": 1382839200000,
  510. "s": 1376100000000
  511. },
  512. {
  513. "e": 1414288800000,
  514. "s": 1406944800000
  515. }
  516. ]
  517. },
  518. {
  519. "name": "America/Asuncion",
  520. "rules": [
  521. {
  522. "e": 1205031600000,
  523. "s": 1224388800000
  524. },
  525. {
  526. "e": 1236481200000,
  527. "s": 1255838400000
  528. },
  529. {
  530. "e": 1270954800000,
  531. "s": 1286078400000
  532. },
  533. {
  534. "e": 1302404400000,
  535. "s": 1317528000000
  536. },
  537. {
  538. "e": 1333854000000,
  539. "s": 1349582400000
  540. },
  541. {
  542. "e": 1364094000000,
  543. "s": 1381032000000
  544. },
  545. {
  546. "e": 1395543600000,
  547. "s": 1412481600000
  548. }
  549. ]
  550. },
  551. {
  552. "name": "America/Campo_Grande",
  553. "rules": [
  554. {
  555. "e": 1203217200000,
  556. "s": 1224388800000
  557. },
  558. {
  559. "e": 1234666800000,
  560. "s": 1255838400000
  561. },
  562. {
  563. "e": 1266721200000,
  564. "s": 1287288000000
  565. },
  566. {
  567. "e": 1298170800000,
  568. "s": 1318737600000
  569. },
  570. {
  571. "e": 1330225200000,
  572. "s": 1350792000000
  573. },
  574. {
  575. "e": 1361070000000,
  576. "s": 1382241600000
  577. },
  578. {
  579. "e": 1392519600000,
  580. "s": 1413691200000
  581. }
  582. ]
  583. },
  584. {
  585. "name": "America/Goose_Bay",
  586. "rules": [
  587. {
  588. "e": 1225594860000,
  589. "s": 1205035260000
  590. },
  591. {
  592. "e": 1257044460000,
  593. "s": 1236484860000
  594. },
  595. {
  596. "e": 1289098860000,
  597. "s": 1268539260000
  598. },
  599. {
  600. "e": 1320555600000,
  601. "s": 1299988860000
  602. },
  603. {
  604. "e": 1352005200000,
  605. "s": 1331445600000
  606. },
  607. {
  608. "e": 1383454800000,
  609. "s": 1362895200000
  610. },
  611. {
  612. "e": 1414904400000,
  613. "s": 1394344800000
  614. }
  615. ]
  616. },
  617. {
  618. "name": "America/Havana",
  619. "rules": [
  620. {
  621. "e": 1224997200000,
  622. "s": 1205643600000
  623. },
  624. {
  625. "e": 1256446800000,
  626. "s": 1236488400000
  627. },
  628. {
  629. "e": 1288501200000,
  630. "s": 1268542800000
  631. },
  632. {
  633. "e": 1321160400000,
  634. "s": 1300597200000
  635. },
  636. {
  637. "e": 1352005200000,
  638. "s": 1333256400000
  639. },
  640. {
  641. "e": 1383454800000,
  642. "s": 1362891600000
  643. },
  644. {
  645. "e": 1414904400000,
  646. "s": 1394341200000
  647. }
  648. ]
  649. },
  650. {
  651. "name": "America/Mazatlan",
  652. "rules": [
  653. {
  654. "e": 1225008000000,
  655. "s": 1207472400000
  656. },
  657. {
  658. "e": 1256457600000,
  659. "s": 1238922000000
  660. },
  661. {
  662. "e": 1288512000000,
  663. "s": 1270371600000
  664. },
  665. {
  666. "e": 1319961600000,
  667. "s": 1301821200000
  668. },
  669. {
  670. "e": 1351411200000,
  671. "s": 1333270800000
  672. },
  673. {
  674. "e": 1382860800000,
  675. "s": 1365325200000
  676. },
  677. {
  678. "e": 1414310400000,
  679. "s": 1396774800000
  680. }
  681. ]
  682. },
  683. {
  684. "name": "America/Mexico_City",
  685. "rules": [
  686. {
  687. "e": 1225004400000,
  688. "s": 1207468800000
  689. },
  690. {
  691. "e": 1256454000000,
  692. "s": 1238918400000
  693. },
  694. {
  695. "e": 1288508400000,
  696. "s": 1270368000000
  697. },
  698. {
  699. "e": 1319958000000,
  700. "s": 1301817600000
  701. },
  702. {
  703. "e": 1351407600000,
  704. "s": 1333267200000
  705. },
  706. {
  707. "e": 1382857200000,
  708. "s": 1365321600000
  709. },
  710. {
  711. "e": 1414306800000,
  712. "s": 1396771200000
  713. }
  714. ]
  715. },
  716. {
  717. "name": "America/Miquelon",
  718. "rules": [
  719. {
  720. "e": 1225598400000,
  721. "s": 1205038800000
  722. },
  723. {
  724. "e": 1257048000000,
  725. "s": 1236488400000
  726. },
  727. {
  728. "e": 1289102400000,
  729. "s": 1268542800000
  730. },
  731. {
  732. "e": 1320552000000,
  733. "s": 1299992400000
  734. },
  735. {
  736. "e": 1352001600000,
  737. "s": 1331442000000
  738. },
  739. {
  740. "e": 1383451200000,
  741. "s": 1362891600000
  742. },
  743. {
  744. "e": 1414900800000,
  745. "s": 1394341200000
  746. }
  747. ]
  748. },
  749. {
  750. "name": "America/Santa_Isabel",
  751. "rules": [
  752. {
  753. "e": 1225011600000,
  754. "s": 1207476000000
  755. },
  756. {
  757. "e": 1256461200000,
  758. "s": 1238925600000
  759. },
  760. {
  761. "e": 1288515600000,
  762. "s": 1270375200000
  763. },
  764. {
  765. "e": 1319965200000,
  766. "s": 1301824800000
  767. },
  768. {
  769. "e": 1351414800000,
  770. "s": 1333274400000
  771. },
  772. {
  773. "e": 1382864400000,
  774. "s": 1365328800000
  775. },
  776. {
  777. "e": 1414314000000,
  778. "s": 1396778400000
  779. }
  780. ]
  781. },
  782. {
  783. "name": "America/Santiago",
  784. "rules": [
  785. {
  786. "e": 1206846000000,
  787. "s": 1223784000000
  788. },
  789. {
  790. "e": 1237086000000,
  791. "s": 1255233600000
  792. },
  793. {
  794. "e": 1270350000000,
  795. "s": 1286683200000
  796. },
  797. {
  798. "e": 1304823600000,
  799. "s": 1313899200000
  800. },
  801. {
  802. "e": 1335668400000,
  803. "s": 1346558400000
  804. },
  805. {
  806. "e": 1367118000000,
  807. "s": 1378612800000
  808. },
  809. {
  810. "e": 1398567600000,
  811. "s": 1410062400000
  812. }
  813. ]
  814. },
  815. {
  816. "name": "America/Sao_Paulo",
  817. "rules": [
  818. {
  819. "e": 1203213600000,
  820. "s": 1224385200000
  821. },
  822. {
  823. "e": 1234663200000,
  824. "s": 1255834800000
  825. },
  826. {
  827. "e": 1266717600000,
  828. "s": 1287284400000
  829. },
  830. {
  831. "e": 1298167200000,
  832. "s": 1318734000000
  833. },
  834. {
  835. "e": 1330221600000,
  836. "s": 1350788400000
  837. },
  838. {
  839. "e": 1361066400000,
  840. "s": 1382238000000
  841. },
  842. {
  843. "e": 1392516000000,
  844. "s": 1413687600000
  845. }
  846. ]
  847. },
  848. {
  849. "name": "Asia/Amman",
  850. "rules": [
  851. {
  852. "e": 1225404000000,
  853. "s": 1206655200000
  854. },
  855. {
  856. "e": 1256853600000,
  857. "s": 1238104800000
  858. },
  859. {
  860. "e": 1288303200000,
  861. "s": 1269554400000
  862. },
  863. {
  864. "e": 1319752800000,
  865. "s": 1301608800000
  866. },
  867. false,
  868. false,
  869. {
  870. "e": 1414706400000,
  871. "s": 1395957600000
  872. }
  873. ]
  874. },
  875. {
  876. "name": "Asia/Damascus",
  877. "rules": [
  878. {
  879. "e": 1225486800000,
  880. "s": 1207260000000
  881. },
  882. {
  883. "e": 1256850000000,
  884. "s": 1238104800000
  885. },
  886. {
  887. "e": 1288299600000,
  888. "s": 1270159200000
  889. },
  890. {
  891. "e": 1319749200000,
  892. "s": 1301608800000
  893. },
  894. {
  895. "e": 1351198800000,
  896. "s": 1333058400000
  897. },
  898. {
  899. "e": 1382648400000,
  900. "s": 1364508000000
  901. },
  902. {
  903. "e": 1414702800000,
  904. "s": 1395957600000
  905. }
  906. ]
  907. },
  908. {
  909. "name": "Asia/Dubai",
  910. "rules": [
  911. false,
  912. false,
  913. false,
  914. false,
  915. false,
  916. false,
  917. false
  918. ]
  919. },
  920. {
  921. "name": "Asia/Gaza",
  922. "rules": [
  923. {
  924. "e": 1219957200000,
  925. "s": 1206655200000
  926. },
  927. {
  928. "e": 1252015200000,
  929. "s": 1238104800000
  930. },
  931. {
  932. "e": 1281474000000,
  933. "s": 1269640860000
  934. },
  935. {
  936. "e": 1312146000000,
  937. "s": 1301608860000
  938. },
  939. {
  940. "e": 1348178400000,
  941. "s": 1333058400000
  942. },
  943. {
  944. "e": 1380229200000,
  945. "s": 1364508000000
  946. },
  947. {
  948. "e": 1414098000000,
  949. "s": 1395957600000
  950. }
  951. ]
  952. },
  953. {
  954. "name": "Asia/Irkutsk",
  955. "rules": [
  956. {
  957. "e": 1224957600000,
  958. "s": 1206813600000
  959. },
  960. {
  961. "e": 1256407200000,
  962. "s": 1238263200000
  963. },
  964. {
  965. "e": 1288461600000,
  966. "s": 1269712800000
  967. },
  968. false,
  969. false,
  970. false,
  971. false
  972. ]
  973. },
  974. {
  975. "name": "Asia/Jerusalem",
  976. "rules": [
  977. {
  978. "e": 1223161200000,
  979. "s": 1206662400000
  980. },
  981. {
  982. "e": 1254006000000,
  983. "s": 1238112000000
  984. },
  985. {
  986. "e": 1284246000000,
  987. "s": 1269561600000
  988. },
  989. {
  990. "e": 1317510000000,
  991. "s": 1301616000000
  992. },
  993. {
  994. "e": 1348354800000,
  995. "s": 1333065600000
  996. },
  997. {
  998. "e": 1382828400000,
  999. "s": 1364515200000
  1000. },
  1001. {
  1002. "e": 1414278000000,
  1003. "s": 1395964800000
  1004. }
  1005. ]
  1006. },
  1007. {
  1008. "name": "Asia/Kamchatka",
  1009. "rules": [
  1010. {
  1011. "e": 1224943200000,
  1012. "s": 1206799200000
  1013. },
  1014. {
  1015. "e": 1256392800000,
  1016. "s": 1238248800000
  1017. },
  1018. {
  1019. "e": 1288450800000,
  1020. "s": 1269698400000
  1021. },
  1022. false,
  1023. false,
  1024. false,
  1025. false
  1026. ]
  1027. },
  1028. {
  1029. "name": "Asia/Krasnoyarsk",
  1030. "rules": [
  1031. {
  1032. "e": 1224961200000,
  1033. "s": 1206817200000
  1034. },
  1035. {
  1036. "e": 1256410800000,
  1037. "s": 1238266800000
  1038. },
  1039. {
  1040. "e": 1288465200000,
  1041. "s": 1269716400000
  1042. },
  1043. false,
  1044. false,
  1045. false,
  1046. false
  1047. ]
  1048. },
  1049. {
  1050. "name": "Asia/Omsk",
  1051. "rules": [
  1052. {
  1053. "e": 1224964800000,
  1054. "s": 1206820800000
  1055. },
  1056. {
  1057. "e": 1256414400000,
  1058. "s": 1238270400000
  1059. },
  1060. {
  1061. "e": 1288468800000,
  1062. "s": 1269720000000
  1063. },
  1064. false,
  1065. false,
  1066. false,
  1067. false
  1068. ]
  1069. },
  1070. {
  1071. "name": "Asia/Vladivostok",
  1072. "rules": [
  1073. {
  1074. "e": 1224950400000,
  1075. "s": 1206806400000
  1076. },
  1077. {
  1078. "e": 1256400000000,
  1079. "s": 1238256000000
  1080. },
  1081. {
  1082. "e": 1288454400000,
  1083. "s": 1269705600000
  1084. },
  1085. false,
  1086. false,
  1087. false,
  1088. false
  1089. ]
  1090. },
  1091. {
  1092. "name": "Asia/Yakutsk",
  1093. "rules": [
  1094. {
  1095. "e": 1224954000000,
  1096. "s": 1206810000000
  1097. },
  1098. {
  1099. "e": 1256403600000,
  1100. "s": 1238259600000
  1101. },
  1102. {
  1103. "e": 1288458000000,
  1104. "s": 1269709200000
  1105. },
  1106. false,
  1107. false,
  1108. false,
  1109. false
  1110. ]
  1111. },
  1112. {
  1113. "name": "Asia/Yekaterinburg",
  1114. "rules": [
  1115. {
  1116. "e": 1224968400000,
  1117. "s": 1206824400000
  1118. },
  1119. {
  1120. "e": 1256418000000,
  1121. "s": 1238274000000
  1122. },
  1123. {
  1124. "e": 1288472400000,
  1125. "s": 1269723600000
  1126. },
  1127. false,
  1128. false,
  1129. false,
  1130. false
  1131. ]
  1132. },
  1133. {
  1134. "name": "Asia/Yerevan",
  1135. "rules": [
  1136. {
  1137. "e": 1224972000000,
  1138. "s": 1206828000000
  1139. },
  1140. {
  1141. "e": 1256421600000,
  1142. "s": 1238277600000
  1143. },
  1144. {
  1145. "e": 1288476000000,
  1146. "s": 1269727200000
  1147. },
  1148. {
  1149. "e": 1319925600000,
  1150. "s": 1301176800000
  1151. },
  1152. false,
  1153. false,
  1154. false
  1155. ]
  1156. },
  1157. {
  1158. "name": "Australia/Lord_Howe",
  1159. "rules": [
  1160. {
  1161. "e": 1207407600000,
  1162. "s": 1223134200000
  1163. },
  1164. {
  1165. "e": 1238857200000,
  1166. "s": 1254583800000
  1167. },
  1168. {
  1169. "e": 1270306800000,
  1170. "s": 1286033400000
  1171. },
  1172. {
  1173. "e": 1301756400000,
  1174. "s": 1317483000000
  1175. },
  1176. {
  1177. "e": 1333206000000,
  1178. "s": 1349537400000
  1179. },
  1180. {
  1181. "e": 1365260400000,
  1182. "s": 1380987000000
  1183. },
  1184. {
  1185. "e": 1396710000000,
  1186. "s": 1412436600000
  1187. }
  1188. ]
  1189. },
  1190. {
  1191. "name": "Australia/Perth",
  1192. "rules": [
  1193. {
  1194. "e": 1206813600000,
  1195. "s": 1224957600000
  1196. },
  1197. false,
  1198. false,
  1199. false,
  1200. false,
  1201. false,
  1202. false
  1203. ]
  1204. },
  1205. {
  1206. "name": "Europe/Helsinki",
  1207. "rules": [
  1208. {
  1209. "e": 1224982800000,
  1210. "s": 1206838800000
  1211. },
  1212. {
  1213. "e": 1256432400000,
  1214. "s": 1238288400000
  1215. },
  1216. {
  1217. "e": 1288486800000,
  1218. "s": 1269738000000
  1219. },
  1220. {
  1221. "e": 1319936400000,
  1222. "s": 1301187600000
  1223. },
  1224. {
  1225. "e": 1351386000000,
  1226. "s": 1332637200000
  1227. },
  1228. {
  1229. "e": 1382835600000,
  1230. "s": 1364691600000
  1231. },
  1232. {
  1233. "e": 1414285200000,
  1234. "s": 1396141200000
  1235. }
  1236. ]
  1237. },
  1238. {
  1239. "name": "Europe/Minsk",
  1240. "rules": [
  1241. {
  1242. "e": 1224979200000,
  1243. "s": 1206835200000
  1244. },
  1245. {
  1246. "e": 1256428800000,
  1247. "s": 1238284800000
  1248. },
  1249. {
  1250. "e": 1288483200000,
  1251. "s": 1269734400000
  1252. },
  1253. false,
  1254. false,
  1255. false,
  1256. false
  1257. ]
  1258. },
  1259. {
  1260. "name": "Europe/Moscow",
  1261. "rules": [
  1262. {
  1263. "e": 1224975600000,
  1264. "s": 1206831600000
  1265. },
  1266. {
  1267. "e": 1256425200000,
  1268. "s": 1238281200000
  1269. },
  1270. {
  1271. "e": 1288479600000,
  1272. "s": 1269730800000
  1273. },
  1274. false,
  1275. false,
  1276. false,
  1277. false
  1278. ]
  1279. },
  1280. {
  1281. "name": "Pacific/Apia",
  1282. "rules": [
  1283. false,
  1284. false,
  1285. false,
  1286. {
  1287. "e": 1301752800000,
  1288. "s": 1316872800000
  1289. },
  1290. {
  1291. "e": 1333202400000,
  1292. "s": 1348927200000
  1293. },
  1294. {
  1295. "e": 1365256800000,
  1296. "s": 1380376800000
  1297. },
  1298. {
  1299. "e": 1396706400000,
  1300. "s": 1411826400000
  1301. }
  1302. ]
  1303. },
  1304. {
  1305. "name": "Pacific/Fiji",
  1306. "rules": [
  1307. false,
  1308. false,
  1309. {
  1310. "e": 1269698400000,
  1311. "s": 1287842400000
  1312. },
  1313. {
  1314. "e": 1327154400000,
  1315. "s": 1319292000000
  1316. },
  1317. {
  1318. "e": 1358604000000,
  1319. "s": 1350741600000
  1320. },
  1321. {
  1322. "e": 1390050000000,
  1323. "s": 1382796000000
  1324. },
  1325. {
  1326. "e": 1421503200000,
  1327. "s": 1414850400000
  1328. }
  1329. ]
  1330. },
  1331. {
  1332. "name": "Europe/London",
  1333. "rules": [
  1334. {
  1335. "e": 1224982800000,
  1336. "s": 1206838800000
  1337. },
  1338. {
  1339. "e": 1256432400000,
  1340. "s": 1238288400000
  1341. },
  1342. {
  1343. "e": 1288486800000,
  1344. "s": 1269738000000
  1345. },
  1346. {
  1347. "e": 1319936400000,
  1348. "s": 1301187600000
  1349. },
  1350. {
  1351. "e": 1351386000000,
  1352. "s": 1332637200000
  1353. },
  1354. {
  1355. "e": 1382835600000,
  1356. "s": 1364691600000
  1357. },
  1358. {
  1359. "e": 1414285200000,
  1360. "s": 1396141200000
  1361. }
  1362. ]
  1363. }
  1364. ]
  1365. };
  1366. if (typeof module !== 'undefined' && typeof module.exports !== 'undefined') {
  1367. module.exports = jstz;
  1368. } else if ((typeof define !== 'undefined' && define !== null) && (define.amd != null)) {
  1369. define([], function() {
  1370. return jstz;
  1371. });
  1372. } else {
  1373. if (typeof root === 'undefined') {
  1374. window.jstz = jstz;
  1375. } else {
  1376. root.jstz = jstz;
  1377. }
  1378. }
  1379. }());