Convert timezone shift in seconds from UTC in javascript

Hello, I am giving a call to an weather API which returns me a JSON containing timezone -25200 and in the docs it is mentioned as “timezone: Shift in seconds from UTC” I want to convert this in actual date and time by using JavaScript.

{
      "timezone": -25200,
      "id": 420006353,
      "name": "Mountain View",
      "cod": 200
}       

Please tell me how to convert this “timezone:-25200” in actual time.

That timezone is the number of seconds you must add to the UTC timestamp to get the local time. In your case it is equal to subtracting seven hours from the timestamp. (-25200 / 3600 = -7).

You seem to be in the North American Pacific Daylight time zone, known to computer programs everywhere as America/Los_Angeles or America/Vancouver.

But Javascript times are in milliseconds.

const nowInLocalTime = Date.now()  + 1000 * ob.timezone

gets you the number of milliseconds since 1970-01-01 00:00 in your local time.

Well, I am using below code to convert those milliseconds to actual time.

const dateBuilder = (timezone) => {
   
        const nowInLocalTime = Date.now()  + 1000 * (timezone / 3600);
        const millitime = new Date(nowInLocalTime);
        const dateFormat = millitime.toLocaleString();

        let day = millitime.toLocaleString("en-US", {weekday: "long"});
        let month = millitime.toLocaleString("en-US", {month: "long"}); 
        let date = millitime.toLocaleString("en-US", {day: "numeric"});
        let year = millitime.toLocaleString("en-US", {year: "numeric"}); 
        let hours = millitime.toLocaleString("en-US", {hour: "numeric"}); 
        let minutes = millitime.toLocaleString("en-US", {minute: "numeric"});
    
        return `${day} ${date} ${month} ${year} ${hours}:${minutes}`;
    }

And this code gives me time Saturday 26 December 2020 9 PM:24, for the location New York but it’s wrong, in New York now it’s 10:56AM, I also tried for the location London, but it gives me same time.

Please tell me where I made mistake.