-3

function convertUTCDateToLocalDate(date) {

var newDate = new Date(date);
var oldDate = new Date(date);
newDate.setMinutes(oldDate.getMinutes() - oldDate.getTimezoneOffset());
return newDate;

}

Akshay D
  • 1
  • 2
  • You are talking about string representations, but your code returns a Date object. A Date object is just that, and its key information is an integer number. It doesn't define a string representation. – trincot May 27 '21 at 15:27

0 Answers0