// I couldn't get the LoadTimeZoneRule command to work so this is the workaround :/

static float offset = -1;

static char const *timezones[447] = {"Etc/GMT+12",
			       "Etc/GMT+11",
			       "Pacific/Midway",
			       "Pacific/Niue",
			       "Pacific/Pago_Pago",
			       "Etc/GMT+10",
			       "Pacific/Honolulu",
			       "Pacific/Johnston",
			       "Pacific/Rarotonga",
			       "Pacific/Tahiti",
			       "America/Anchorage",
			       "America/Juneau",
			       "America/Nome",
			       "America/Sitka",
			       "America/Yakutat",
			       "America/Santa_Isabel",
			       "America/Dawson",
			       "America/Los_Angeles",
			       "America/Tijuana",
			       "America/Vancouver",
			       "America/Whitehorse",
			       "PST8PDT",
			       "America/Creston",
			       "America/Dawson_Creek",
			       "America/Hermosillo",
			       "America/Phoenix",
			       "Etc/GMT+7",
			       "America/Chihuahua",
			       "America/Mazatlan",
			       "America/Boise",
			       "America/Cambridge_Bay",
			       "America/Denver",
			       "America/Edmonton",
			       "America/Inuvik",
			       "America/Ojinaga",
			       "America/Yellowknife",
			       "MST7MDT",
			       "America/Belize",
			       "America/Costa_Rica",
			       "America/El_Salvador",
			       "America/Guatemala",
			       "America/Managua",
			       "America/Tegucigalpa",
			       "Etc/GMT+6",
			       "Pacific/Galapagos",
			       "America/Chicago",
			       "America/Indiana/Knox",
			       "America/Indiana/Tell_City",
			       "America/Matamoros",
			       "America/Menominee",
			       "America/North_Dakota/Beulah",
			       "America/North_Dakota/Center",
			       "America/North_Dakota/New_Salem",
			       "America/Rainy_River",
			       "America/Rankin_Inlet",
			       "America/Resolute",
			       "America/Winnipeg",
			       "CST6CDT",
			       "America/Bahia_Banderas",
			       "America/Cancun",
			       "America/Merida",
			       "America/Mexico_City",
			       "America/Monterrey",
			       "America/Regina",
			       "America/Swift_Current",
			       "America/Bogota",
			       "America/Cayman",
			       "America/Coral_Harbour",
			       "America/Eirunepe",
			       "America/Guayaquil",
			       "America/Jamaica",
			       "America/Lima",
			       "America/Panama",
			       "America/Rio_Branco",
			       "Etc/GMT+5",
			       "America/Detroit",
			       "America/Havana",
			       "America/Indiana/Petersburg",
			       "America/Indiana/Vincennes",
			       "America/Indiana/Winamac",
			       "America/Iqaluit",
			       "America/Kentucky/Monticello",
			       "America/Louisville",
			       "America/Montreal",
			       "America/Nassau",
			       "America/New_York",
			       "America/Nipigon",
			       "America/Pangnirtung",
			       "America/Port-au-Prince",
			       "America/Thunder_Bay",
			       "America/Toronto",
			       "EST5EDT",
			       "America/Indiana/Marengo",
			       "America/Indiana/Vevay",
			       "America/Indianapolis",
			       "America/Caracas",
			       "America/Asuncion",
			       "America/Glace_Bay",
			       "America/Goose_Bay",
			       "America/Halifax",
			       "America/Moncton",
			       "America/Thule",
			       "Atlantic/Bermuda",
			       "America/Campo_Grande",
			       "America/Cuiaba",
			       "America/Anguilla",
			       "America/Antigua",
			       "America/Aruba",
			       "America/Barbados",
			       "America/Blanc-Sablon",
			       "America/Boa_Vista",
			       "America/Curacao",
			       "America/Dominica",
			       "America/Grand_Turk",
			       "America/Grenada",
			       "America/Guadeloupe",
			       "America/Guyana",
			       "America/Kralendijk",
			       "America/La_Paz",
			       "America/Lower_Princes",
			       "America/Manaus",
			       "America/Marigot",
			       "America/Martinique",
			       "America/Montserrat",
			       "America/Port_of_Spain",
			       "America/Porto_Velho",
			       "America/Puerto_Rico",
			       "America/Santo_Domingo",
			       "America/St_Barthelemy",
			       "America/St_Kitts",
			       "America/St_Lucia",
			       "America/St_Thomas",
			       "America/St_Vincent",
			       "America/Tortola",
			       "Etc/GMT+4",
			       "America/Santiago",
			       "Antarctica/Palmer",
			       "America/St_Johns",
			       "America/Sao_Paulo",
			       "America/Argentina/La_Rioja",
			       "America/Argentina/Rio_Gallegos",
			       "America/Argentina/Salta",
			       "America/Argentina/San_Juan",
			       "America/Argentina/San_Luis",
			       "America/Argentina/Tucuman",
			       "America/Argentina/Ushuaia",
			       "America/Buenos_Aires",
			       "America/Catamarca",
			       "America/Cordoba",
			       "America/Jujuy",
			       "America/Mendoza",
			       "America/Araguaina",
			       "America/Belem",
			       "America/Cayenne",
			       "America/Fortaleza",
			       "America/Maceio",
			       "America/Paramaribo",
			       "America/Recife",
			       "America/Santarem",
			       "Antarctica/Rothera",
			       "Atlantic/Stanley",
			       "Etc/GMT+3",
			       "America/Godthab",
			       "America/Montevideo",
			       "America/Bahia",
			       "America/Noronha",
			       "Atlantic/South_Georgia",
			       "Etc/GMT+2",
			       "America/Scoresbysund",
			       "Atlantic/Azores",
			       "Atlantic/Cape_Verde",
			       "Etc/GMT+1",
			       "Africa/Casablanca",
			       "Africa/El_Aaiun",
			       "America/Danmarkshavn",
			       "Etc/GMT",
			       "Atlantic/Canary",
			       "Atlantic/Faeroe",
			       "Atlantic/Madeira",
			       "Europe/Dublin",
			       "Europe/Guernsey",
			       "Europe/Isle_of_Man",
			       "Europe/Jersey",
			       "Europe/Lisbon",
			       "Europe/London",
			       "Africa/Abidjan",
			       "Africa/Accra",
			       "Africa/Bamako",
			       "Africa/Banjul",
			       "Africa/Bissau",
			       "Africa/Conakry",
			       "Africa/Dakar",
			       "Africa/Freetown",
			       "Africa/Lome",
			       "Africa/Monrovia",
			       "Africa/Nouakchott",
			       "Africa/Ouagadougou",
			       "Africa/Sao_Tome",
			       "Atlantic/Reykjavik",
			       "Atlantic/St_Helena",
			       "Arctic/Longyearbyen",
			       "Europe/Amsterdam",
			       "Europe/Andorra",
			       "Europe/Berlin",
			       "Europe/Busingen",
			       "Europe/Gibraltar",
			       "Europe/Luxembourg",
			       "Europe/Malta",
			       "Europe/Monaco",
			       "Europe/Oslo",
			       "Europe/Rome",
			       "Europe/San_Marino",
			       "Europe/Stockholm",
			       "Europe/Vaduz",
			       "Europe/Vatican",
			       "Europe/Vienna",
			       "Europe/Zurich",
			       "Europe/Belgrade",
			       "Europe/Bratislava",
			       "Europe/Budapest",
			       "Europe/Ljubljana",
			       "Europe/Podgorica",
			       "Europe/Prague",
			       "Europe/Tirane",
			       "Africa/Ceuta",
			       "Europe/Brussels",
			       "Europe/Copenhagen",
			       "Europe/Madrid",
			       "Europe/Paris",
			       "Europe/Sarajevo",
			       "Europe/Skopje",
			       "Europe/Warsaw",
			       "Europe/Zagreb",
			       "Africa/Algiers",
			       "Africa/Bangui",
			       "Africa/Brazzaville",
			       "Africa/Douala",
			       "Africa/Kinshasa",
			       "Africa/Lagos",
			       "Africa/Libreville",
			       "Africa/Luanda",
			       "Africa/Malabo",
			       "Africa/Ndjamena",
			       "Africa/Niamey",
			       "Africa/Porto-Novo",
			       "Africa/Tunis",
			       "Etc/GMT-1",
			       "Africa/Windhoek",
			       "Asia/Nicosia",
			       "Europe/Athens",
			       "Europe/Bucharest",
			       "Europe/Chisinau",
			       "Asia/Beirut",
			       "Africa/Cairo",
			       "Asia/Damascus",
			       "Asia/Nicosia",
			       "Europe/Athens",
			       "Europe/Bucharest",
			       "Europe/Chisinau",
			       "Europe/Helsinki",
			       "Europe/Kiev",
			       "Europe/Mariehamn",
			       "Europe/Nicosia",
			       "Europe/Riga",
			       "Europe/Sofia",
			       "Europe/Tallinn",
			       "Europe/Uzhgorod",
			       "Europe/Vilnius",
			       "Europe/Zaporozhye",
			       "Africa/Blantyre",
			       "Africa/Bujumbura",
			       "Africa/Gaborone",
			       "Africa/Harare",
			       "Africa/Johannesburg",
			       "Africa/Kigali",
			       "Africa/Lubumbashi",
			       "Africa/Lusaka",
			       "Africa/Maputo",
			       "Africa/Maseru",
			       "Africa/Mbabane",
			       "Etc/GMT-2",
			       "Europe/Helsinki",
			       "Europe/Kiev",
			       "Europe/Mariehamn",
			       "Europe/Riga",
			       "Europe/Sofia",
			       "Europe/Tallinn",
			       "Europe/Uzhgorod",
			       "Europe/Vilnius",
			       "Europe/Zaporozhye",
			       "Europe/Istanbul",
			       "Asia/Jerusalem",
			       "Africa/Tripoli",
			       "Asia/Amman",
			       "Asia/Baghdad",
			       "Europe/Kaliningrad",
			       "Europe/Minsk",
			       "Asia/Aden",
			       "Asia/Bahrain",
			       "Asia/Kuwait",
			       "Asia/Qatar",
			       "Asia/Riyadh",
			       "Africa/Addis_Ababa",
			       "Africa/Asmera",
			       "Africa/Dar_es_Salaam",
			       "Africa/Djibouti",
			       "Africa/Juba",
			       "Africa/Kampala",
			       "Africa/Khartoum",
			       "Africa/Mogadishu",
			       "Africa/Nairobi",
			       "Antarctica/Syowa",
			       "Etc/GMT-3",
			       "Indian/Antananarivo",
			       "Indian/Comoro",
			       "Indian/Mayotte",
			       "Europe/Kirov",
			       "Europe/Moscow",
			       "Europe/Simferopol",
			       "Europe/Volgograd",
			       "Europe/Astrakhan",
			       "Europe/Samara",
			       "Europe/Ulyanovsk",
			       "Asia/Tehran",
			       "Asia/Dubai",
			       "Asia/Muscat",
			       "Etc/GMT-4",
			       "Asia/Baku",
			       "Indian/Mahe",
			       "Indian/Mauritius",
			       "Indian/Reunion",
			       "Asia/Tbilisi",
			       "Asia/Yerevan",
			       "Asia/Kabul",
			       "Antarctica/Mawson",
			       "Asia/Aqtau",
			       "Asia/Aqtobe",
			       "Asia/Ashgabat",
			       "Asia/Dushanbe",
			       "Asia/Oral",
			       "Asia/Samarkand",
			       "Asia/Tashkent",
			       "Etc/GMT-5",
			       "Indian/Kerguelen",
			       "Indian/Maldives",
			       "Asia/Karachi",
			       "Asia/Kolkata",
			       "Asia/Colombo",
			       "Asia/Katmandu",
			       "Antarctica/Vostok",
			       "Asia/Almaty",
			       "Asia/Bishkek",
			       "Asia/Qyzylorda",
			       "Asia/Urumqi",
			       "Etc/GMT-6",
			       "Indian/Chagos",
			       "Asia/Dhaka",
			       "Asia/Thimphu",
			       "Asia/Yekaterinburg",
			       "Asia/Rangoon",
			       "Indian/Cocos",
			       "Antarctica/Davis",
			       "Asia/Bangkok",
			       "Asia/Hovd",
			       "Asia/Jakarta",
			       "Asia/Phnom_Penh",
			       "Asia/Pontianak",
			       "Asia/Saigon",
			       "Asia/Vientiane",
			       "Etc/GMT-7",
			       "Indian/Christmas",
			       "Asia/Novokuznetsk",
			       "Asia/Novosibirsk",
			       "Asia/Omsk",
			       "Asia/Hong_Kong",
			       "Asia/Macau",
			       "Asia/Shanghai",
			       "Asia/Krasnoyarsk",
			       "Asia/Brunei",
			       "Asia/Kuala_Lumpur",
			       "Asia/Kuching",
			       "Asia/Makassar",
			       "Asia/Manila",
			       "Asia/Singapore",
			       "Etc/GMT-8",
			       "Antarctica/Casey",
			       "Australia/Perth",
			       "Asia/Taipei",
			       "Asia/Choibalsan",
			       "Asia/Ulaanbaatar",
			       "Asia/Irkutsk",
			       "Asia/Dili",
			       "Asia/Jayapura",
			       "Asia/Tokyo",
			       "Etc/GMT-9",
			       "Pacific/Palau",
			       "Asia/Pyongyang",
			       "Asia/Seoul",
			       "Australia/Adelaide",
			       "Australia/Broken_Hill",
			       "Australia/Darwin",
			       "Australia/Brisbane",
			       "Australia/Lindeman",
			       "Australia/Melbourne",
			       "Australia/Sydney",
			       "Antarctica/DumontDUrville",
			       "Etc/GMT-10",
			       "Pacific/Guam",
			       "Pacific/Port_Moresby",
			       "Pacific/Saipan",
			       "Pacific/Truk",
			       "Australia/Currie",
			       "Australia/Hobart",
			       "Asia/Chita",
			       "Asia/Khandyga",
			       "Asia/Yakutsk",
			       "Antarctica/Macquarie",
			       "Etc/GMT-11",
			       "Pacific/Efate",
			       "Pacific/Guadalcanal",
			       "Pacific/Kosrae",
			       "Pacific/Noumea",
			       "Pacific/Ponape",
			       "Asia/Sakhalin",
			       "Asia/Ust-Nera",
			       "Asia/Vladivostok",
			       "Antarctica/McMurdo",
			       "Pacific/Auckland",
			       "Etc/GMT-12",
			       "Pacific/Funafuti",
			       "Pacific/Kwajalein",
			       "Pacific/Majuro",
			       "Pacific/Nauru",
			       "Pacific/Tarawa",
			       "Pacific/Wake",
			       "Pacific/Wallis",
			       "Pacific/Fiji",
			       "Asia/Anadyr",
			       "Asia/Kamchatka",
			       "Asia/Magadan",
			       "Asia/Srednekolymsk",
			       "Asia/Kamchatka",
			       "Etc/GMT-13",
			       "Pacific/Enderbury",
			       "Pacific/Fakaofo",
			       "Pacific/Tongatapu",
			       "Pacific/Apia"};


static float const timezoneOffsets[447] = {
    -12, -11, -11, -11, -11, -10, -10, -10, -10, -10, -8,  -8,   -8,   -8, -8, -7,  -7, -7, -7, -7, -7, -7, -7, -7,  -7,  -7,   -7, -6,
    -6,  -6,  -6,  -6,  -6,  -6,  -6,  -6,  -6,  -6,  -6,  -6,   -6,   -6, -6, -6,  -6, -5, -5, -5, -5, -5, -5, -5,  -5,  -5,   -5, -5,
    -5,  -5,  -5,  -5,  -5,  -5,  -5,  -6,  -6,  -5,  -5,  -5,   -5,   -5, -5, -5,  -5, -5, -5, -4, -4, -4, -4, -4,  -4,  -4,   -4, -4,
    -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4.5, -4,   -3, -3, -3,  -3, -3, -3, -4, -4, -4, -4, -4,  -4,  -4,   -4, -4,
    -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,  -4,   -4,   -4, -4, -4,  -4, -4, -4, -4, -4, -4, -4, -4,  -4,  -2.5, -3, -3,
    -3,  -3,  -3,  -3,  -3,  -3,  -3,  -3,  -3,  -3,  -3,  -3,   -3,   -3, -3, -3,  -3, -3, -3, -3, -3, -3, -3, -3,  -3,  -2,   -2, -2,
    0,   0,   -1,  -1,  1,   1,   0,   0,   1,   1,   1,   1,    1,    1,  1,  1,   1,  0,  0,  0,  0,  0,  0,  0,   0,   0,    0,  0,
    0,   0,   0,   0,   2,   2,   2,   2,   2,   2,   2,   2,    2,    2,  2,  2,   2,  2,  2,  2,  2,  2,  2,  2,   2,   2,    2,  2,
    2,   2,   2,   2,   2,   2,   2,   2,   2,   1,   1,   1,    1,    1,  1,  1,   1,  1,  1,  1,  1,  1,  1,  1,   3,   3,    3,  3,
    3,   2,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,    3,    3,  3,  3,   3,  2,  2,  2,  2,  2,  2,  2,   2,   2,    2,  2,
    2,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,    2,    3,  3,  3,   3,  3,  3,  3,  3,  3,  3,  3,   3,   3,    3,  3,
    3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,   3,    4,    4,  4,  4.5, 4,  4,  4,  5,  4,  4,  4,  4,   4,   4.5,  5,  5,
    5,   5,   5,   5,   5,   5,   5,   5,   5,   5,   5.5, 5.5,  5.75, 6,  6,  6,   6,  6,  6,  6,  6,  6,  6,  6.5, 6.5, 7,    7,  7,
    7,   7,   7,   7,   7,   7,   7,   7,   7,   7,   8,   8,    8,    8,  8,  8,   8,  8,  8,  8,  8,  8,  8,  8,   8,   8,    9,  9,
    9,   9,   9,   9,   9,   9,   9.5, 9.5, 9.5, 10,  10,  10,   10,   10, 10, 10,  10, 10, 10, 10, 10, 10, 10, 10,  11,  11,   11, 11,
    11,  11,  11,  11,  11,  11,  12,  12,  12,  12,  12,  12,   12,   12, 12, 12,  12, 12, 12, 12, 12, 13, 13, 13,  13,  13,   13};

void setupLocalTimeOffset();
struct tm* getRealLocalTime();
