How to set date always to eastern time regardless of user's time zone
I referred the above link for apply timezones.
THe below code is working fine for EST
var dt = new Date();
console.log(dt);
alert(dt.getTimezoneOffset());
dt.setTime(dt.getTime()+dt.getTimezoneOffset()*60*1000);
console.log(dt);
var offset = -300; //Timezone offset for EST in minutes.
var estDate = new Date(dt.getTime() + offset*60*1000);
console.log(estDate);
Here the offset is var offset = -300; for EST. Similarly I have the list of timezones like
CST, MST, PST, AKST, HST
Here how to calculate the offset for each . Or any other better way to calculate date time new date()
with this timezones.