How to create a date with a set timezone without using a string representation?
new Date(year, month, date, hour, minute, second, millisecond)
Using this method, you can create a date with a set timezone. All you have to do is to use this inbuilt function by typing new Date() and then store the value in a new variable. Then display the contents of this variable using document.getElementById(“demo”).innerHTML.
Using Date() method, a new date is created and that is stored in a variable. then using getTimezoneOffset() method we are able to add or subtract the timezone offset.