4

I have a number, "1546108200", in epoch format.

I want to convert into a date format, like "Sunday, December 30, 2018 12:00:00 AM".

How can I do that?

Peter Mortensen
  • 30,030
  • 21
  • 100
  • 124
K Vinodh Kumar
  • 101
  • 1
  • 1
  • 5

1 Answers1

23

You can use this:

var date = new Date(1546108200 * 1000);
console.log(date.toUTCString())
KyleMit
  • 35,223
  • 60
  • 418
  • 600
Sandeepa
  • 3,052
  • 5
  • 22
  • 38