var td = (new Date('2017-05-16 13:45')); console.log(td); //вывод: 2017-05-16T08:45:00.000Z console.log(td.getHours()); //вывод: 13 

Tell me why such a conclusion? he prints time by GMT. I am in the UTC + 5 zone

    1 answer 1

    To display the date, it is better to use toLocaleString , with options:

     var td = new Date('2017-05-16 13:45'); console.log(td) console.log(td.toLocaleString()) console.log(td.toLocaleString("ru", {timeZone: 'UTC'})) console.log(td.toLocaleString("ru", {timeZone: 'Europe/Moscow'})) console.log(td.toLocaleString("ru", {timeZone: 'Europe/Moscow', era: 'long'})) 

    A list of the remaining options can be found here.