Hello, with the back end `a date comes in milliseconds from the 1970s ...
Question: How can I show this date on the site in a standard format?
Hello, with the back end `a date comes in milliseconds from the 1970s ...
Question: How can I show this date on the site in a standard format?
You can format the date like this:
var m = [ 'Января', 'Февраля', 'Марта', 'Апреля', 'Мая', 'Июня', 'Июля', 'Августа', 'Сентября', 'Октября', 'Ноября', 'Декабря' ]; var a = new Date(1516052901408); var b = ('00' + a.getHours()).slice(-2) + ':' + ('00' + a.getMinutes()).slice(-2) + ' ' + ('00' + a.getDate()).slice(-2) + ' ' + m[a.getMonth()]; console.log(b); Perhaps this plugin will help you: https://github.com/phstc/jquery-dateFormat
Source: https://ru.stackoverflow.com/questions/771247/
All Articles
var a = new Date(1516052901408);so tried? - Rostyslav Kuzmovych