I've the following problem:
I retrieve a DateTime object from SQL Server and pass it via JSON (using $.ajax) to Javascript. I have experienced difficulty trying to convert the retrieved object to a Date object in javascript. The retrieved object is a string of value "/Date(615592800000)/". I think the value is an epoch time.
My question is, is there another way of retrieving the date object than to use regex to select the epoch value and then create a new Date object?
I'm fairly new to JS, so any help would be appreciated.
not that I know... this is the function i'm using, just in case ...
function toDateFromJson(src) {
return new Date(parseInt(src.substr(6)));
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With