How to Convert Milliseconds to Date in Javascript


If you need to convert Milliseconds to Date in Javascript, then you can do the following:

How to Convert Milliseconds to Date in Javascript

let date = new Date(milliseconds);
date.toString();

Common Date Conversions From Milliseconds in Javascript

let originalDate = new Date(milliseconds);

// output: "D/MM/YYYY, H:MM:SS PM/AM"
originalDate.toLocaleString();

//output: "D/MM/YYYY"
originalDate.toLocaleDateString();

// output: "Day Month DD YYYY"
originalDate.toDateString();

// output: "HH:MM:SS GMT+0530"
originalDate.toTimeString();

// output: "Day Month DD YYYY HH:MM:SS GMT+0500"
originalDate.toString();

// output: "H:MM:SS AM/PM"
originalDate.toLocaleTimeString();