abbreviation timezone in javascript code example
Example 1: javascript convert timezone name to abbreviation
<script src="moment.js"></script>
<script src="moment-timezone.js"></script>
<script src="moment-timezone-data.js"></script>
<script>
moment().tz("America/Los_Angeles").zoneAbbr();
</script>
'PDT'
Example 2: javascript date timezone
const start = Date.now();
console.log('starting timer...');
setTimeout(() => {
const millis = Date.now() - start;
console.log(`seconds elapsed = ${Math.floor(millis/1000)}`);
}, 2000);