-2

How to get this date format? Apr 22, 2018 12:44:58 PM

I've tried this code (new Date()).toUTCString() but the result is like Sun, 22 Apr 2018 10:45:19 GMT

Dani
  • 57
  • 10
  • [Check out the answers on this.](https://stackoverflow.com/questions/3552461/how-to-format-a-javascript-date?utm_medium=organic&utm_source=google_rich_qa&utm_campaign=google_rich_qa) – MadaZZ Apr 22 '18 at 11:07

1 Answers1

-1

Easiest way is to leverage MomentJS - you can then use:

moment().format('MMM DD, YYYY hh:mm:ss A')
Conan
  • 2,659
  • 17
  • 24