I was wondering if we can build a zone abbreviations in plain javascript?
I landed in bellow small snippet,
Date.prototype.zoneAbbr = function(){
return (((new Date()).toString().split(/[()]/)[1]).match(/[A-Z]/g) || []).join('')
}
(new Date()).zoneAbbr(); // output - IST
I want to hear if we have better alternative for this? Is there any improvements i can make to this polyfill?