Skip to content

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();
Code language: JavaScript (javascript)

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();
Code language: JavaScript (javascript)

See also  How to Format a Number as a Currency in Javascript
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x