I checked how this is done in Google Chrome, but to be honest, I could not find anything useful other than these two methods that you can use.
I believe this method can help you:
function ToLocalDate (inDate) { var date = new Date(); date.setTime(inDate.valueOf() - 60000 * inDate.getTimezoneOffset()); return date; }
Just check your browser type and call this method accordingly after.
Or you can also use the following method:
var utc_string = '2011-09-05 20:05:15'; var local_string = (function(dtstr) { var t0 = new Date(dtstr); var t1 = Date.parse(t0.toUTCString().replace('GMT', '')); var t2 = (2 * t0) - t1; return new Date(t2).toString(); })(utc_string);
These answers are taken at this address: Convert UTC era to local date using javascript
source share