0

How To Convert dd-mm-yyyy ?

My Ajax Code

enter image description here

My Controller Code

enter image description here

Output

/Date(1608411600000)/
asked Jun 17, 2020 at 18:38
1
  • 2
    Try not to put codes in images. Post them directly into the question description. Commented Jun 17, 2020 at 18:40

2 Answers 2

1

Please try following code in your javascript code block:

new Date(parseInt(data.Result[item].Date)).toDateString()
answered Jun 17, 2020 at 21:45
2
  • new Date(parseInt(data.Result[item].Date)).toDateString() output Invalid Date My Model public DateTime HomeworkDate { get; set; } Commented Jun 18, 2020 at 11:31
  • then can you convert data.Result[item].Date so that you can get 1608411600000 in frontend? Commented Jun 18, 2020 at 11:34
0

Solved

new Date(parseInt(data.Result[item].Date.substr(6)))
answered Jun 18, 2020 at 11:38
0

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

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.