11

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,738
  • 21
  • 105
  • 131
K Vinodh Kumar
  • 171
  • 1
  • 1
  • 6

1 Answers1

34

You can use this:

var date = new Date(1546108200 * 1000);
console.log(date.toUTCString())
KyleMit
  • 30,350
  • 66
  • 462
  • 664
Sandeepa
  • 3,457
  • 5
  • 25
  • 41