-5

I am currently getting the date and time from my database in this format 2019-01-17 10:20:00. Is it possible to change this format to 17 January 2019 10.20 pm to display? I am Using ajax call in JS to retrieve the data. Any help available? Thanks

nmm
  • 107
  • 1
  • 9

1 Answers1

0

Did you try toUTCString()

console.log(new Date('2019-01-17 10:20:00').toUTCString())
Always Sunny
  • 29,081
  • 6
  • 43
  • 74
  • Not recommended to pass non valid ISO formatted strings to `new Date`. Will get inconsistent results across different environments – charlietfl Dec 19 '18 at 15:43