Skip to content

Instantly share code, notes, and snippets.

@serhatcan
Created July 15, 2015 07:21
Show Gist options
  • Save serhatcan/cd585b405bab3520349f to your computer and use it in GitHub Desktop.
Save serhatcan/cd585b405bab3520349f to your computer and use it in GitHub Desktop.
Writes avaliable timezones used in MomentJS. Download moment.js and moment-timezone-with-data.js and put them in the same directory
<html>
<head>
<script src="moment.min.js"></script>
<script src="moment-timezone-with-data.js"></script>
</head>
<body>
<p id="demo"></p>
<script>
var timezones = moment.tz.names();
var text = "";
var i;
for (i = 0; i < timezones.length; i++) {
text += "{name:\"" + timezones[i] + "\"}, <br />";
}
document.getElementById("demo").innerHTML = text;
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment