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 46 times
1 Answers
0
Did you try toUTCString()
console.log(new Date('2019-01-17 10:20:00').toUTCString())
![](../../users/profiles/1138192.webp)
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