How to convert the date in the form of 2017-09-21T21: 00: 00.000Z to the format September 15 (date + name of the month)?
1 answer
like this:
var month = [ 'Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря' ]; var d = new Date('2017-09-01T21:00:00.000Z'); var newDate = d.getDate().toString().padStart(2, '0') + ' ' + month[d.getMonth()]; console.log(newDate); |