Last active
November 22, 2019 07:37
-
-
Save lalitlogical/d9431f1fb49f7f382e9813b86d7c3101 to your computer and use it in GitHub Desktop.
extract timezone from https://timezonedb.com/time-zones website
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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