I'm attempting to convert a Date that is returning from the database as /Date(1570474808430)/
. I'd like to convert it as a standard date time result such as it's appearing in the database as : 2020-08-04 11:08:22.630
. Is this something that is possible? I'm not entirely sure why it appears as date time in the database but is returning as /Date(1570474808430)/
on the front end.
I've attempted to approach this with the following code:
let oldDate = /Date(1570474808430)/
let updatedDate = new Date(oldDate);
console.log(updatedDate)
My expected result is to convert /Date(1570474808430)/
to a date time: 2020-08-04 11:08:22.630