I have a question and basically I need a for a specific function using moment.js which I found here after combing through and working with a lot of suggested options.
I need to get the exact timezone in the format, America/Chicago
or Africa/Cairo
, to perform a redirect to localize pages for news related info. I intend to achieve this using the window.replace.location
, if(Asia/Riyadh var url = arabic.html) else {var url=news24.html}
.
I have tried the var date = new date, var localh = d.gethours var utch = d.getutchours var offset==-4
,
which worked to some extent but achieved inconsitent result due to similar offset amongst other a lot of similar countries. I want to send visitors not in the list of my countries to msn news. Though, I just started getting used to javascript but I know I come along as I have tested so many other stack overflow recommendation, but I am not making any headways as I can't understand how moment.js works and can write the needed codes after linking to the cdn on my html files.