Skip to content

Instantly share code, notes, and snippets.

@lalitlogical
Last active November 22, 2019 07:37
Show Gist options
  • Save lalitlogical/d9431f1fb49f7f382e9813b86d7c3101 to your computer and use it in GitHub Desktop.
Save lalitlogical/d9431f1fb49f7f382e9813b86d7c3101 to your computer and use it in GitHub Desktop.
extract timezone from https://timezonedb.com/time-zones website
var data = [];
$("#content table tbody tr").each(function() {
timezone = {};
$(this).find('td').each(function(index) {
if (index == 0) {
timezone['countryCode'] = $(this).html();
} else if (index == 1) {
timezone['countryName'] = $(this).html();
} else if (index == 2) {
timezone['zoneName'] = $(this).find('a').html();
} else {
timezone['gmtOffset'] = $(this).html();
}
});
data.push(timezone);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment