dima85,
function utcToLocal(date) {
var match = date.match(/\d+|\D+/g);
date = Date.UTC(+match[4], match[2]-1, +match[0], +match[6], +match[8], +match[10]);
date = new Date(date);
match[0] = pad(date.getDate());
match[2] = pad(date.getMonth() + 1);
match[4] = date.getFullYear();
match[6] = pad(date.getHours());
match[8] = pad(date.getMinutes());
match[10] = pad(date.getSeconds());
return match.join('');
function pad(number) {
return number < 10 ? '0' + number : number;
}
}
var $userTime = "03.09.2017 11:11:27";
alert($userTime + '\n' + utcToLocal($userTime));