Currently, I am working on Javascript and dealing with time in milliseconds. I have been successful in displaying the time in GMT format but now I need to convert it to PST timezone. The challenge is that the input time is in milliseconds (e.g. 1671673550214) and I am trying to figure out how to display it in PST format. I have attempted using UTCString(), UTC() and toString(), however, the output always ends up being converted to GMT instead of PST.
var time = new Date().getTime();
var date = new Date(time);
document.write(date.toString());
If there's an alternative method or solution to converting milliseconds to PST timezone, please provide assistance.