In the middle of the night, I found that the backend Bring good people The time field passed to me is actually in the format of timestamp???
Originally, I wanted the backend to change the timestamp to a value that can be seen by the male, but when I looked at the time
2020-09-20 02:06:05
Excuse me, I'll do it myself!!!!
function getdate(time) { var now = new Date(time), y = now.getFullYear(), m = now.getMonth() + 1, d = now.getDate(); return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d) + " " + now.toTimeString().substr(0, 8); } console.log(getdate(1600413432000)); // 2020-09-18 15:17:12