I'm trying to convert my local date or any local date to PST and then into timestamp. For example, this code works to convert the local time to PST:
var offset = -7;
var result = new Date(new Date().getTime() + offset * 3600 * 1000)
.toUTCString()
.replace(/ GMT$/, "");
console.log("Result:", result);
This one return the PST corresponding time, but when I trying to apply the function getTime() (ex: result.getTime(); ) to convert this one on a Unix timestamp, I'm getting an error.
I found the solution: