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
Asked
Active
Viewed 47 times
1 Answers
0
Did you try toUTCString()
console.log(new Date('2019-01-17 10:20:00').toUTCString())
Always Sunny
- 32,751
- 7
- 52
- 86
-
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