I am trying to run the following code however I cannot get the correct output. This script is supposed to be able to change the date and timezone based up the parameters set, however when outputted the time will show correctly for the timezone but the timezone name will always display my local timezone despite it being referenced to use the timezone that has been set in the first time. The timezone is set for EST As you see with the code the timezone is set to EST however the "t" which displays the text version of the timezone is displaying the local timezone and now using the one specified on line one.
function init() {
est = new Date().toLocaleString("en-us", { timeZone: "America/New_York" }); // sets timezone to EST
d = new Date(est); // Declares a new date object
h = d.getHours();
m = d.getMinutes();
s = d.getSeconds();
t = d.toLocaleString('en-us', { timeZoneName: 'short' }).split(' ').pop();
clock();
day = d.getDate();
month = d.getMonth();
year = d.getFullYear();
};