1

I am retrieving the date from SQL Database and the output for date I get is in format /Date(1382612325023)/ [string], How can I convert it to readable date format?

1 Answer 1

2

Like this :

new Date(parseInt('/Date(1382612325023)/'.substr(6)));

explanation :

You take the string you get from db , from index 6 . this will include )/ at the end but parseInt will exclude it. And new Date will work on this value.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.