convert milit second to date javascript 1

convert milit second to date javascript

const milliseconds = 1167696000000

const dateObject = new Date(milliseconds)

const humanDateFormat = dateObject.toLocaleString() //2019-12-9 10:30:15

Here is what the above code is Doing:
1. We create a new Date object with the milliseconds value.
2. We call the toLocaleString() method on the date object to convert it to a human readable format.

Similar Posts