javascript - Is getTimezoneOffset() stable during daylight saving transition? -
i have date time below conversion logic in javascript converting utc time passed timezone's local time. wondering logic work fine during daylight transition? if not remedy that? can't use third party library. have use pure javascript or angular js. function mytime() { var d1= document.getelementbyid("txtdate").value; var zoffset = document.getelementbyid("txtoffset").value; console.log("date1",d1); var d2 = new date(d1.replace(/ /g,'t')); var d3= d2.gettime()+(d2.gettimezoneoffset()*60000); console.log("date2",d2); console.log("date3",d3); var d4 = new date(d3 + (3600000 * zoffset)); console.log("date3",d3); console.log("date 4",d4); var d5 = d4.tolocaletimestring(); console.log("date 5",d5); ...