How To Convert dd-mm-yyyy ?
My Ajax Code
My Controller Code
Output
/Date(1608411600000)/
-
2Try not to put codes in images. Post them directly into the question description.Abhishek Bhagate– Abhishek Bhagate2020年06月17日 18:40:19 +00:00Commented Jun 17, 2020 at 18:40
2 Answers 2
Please try following code in your javascript code block:
new Date(parseInt(data.Result[item].Date)).toDateString()
answered Jun 17, 2020 at 21:45
-
new Date(parseInt(data.Result[item].Date)).toDateString()
output Invalid Date My Modelpublic DateTime HomeworkDate { get; set; }
Burakk46– Burakk462020年06月18日 11:31:50 +00:00Commented Jun 18, 2020 at 11:31 -
then can you convert data.Result[item].Date so that you can get 1608411600000 in frontend?WebDev– WebDev2020年06月18日 11:34:07 +00:00Commented Jun 18, 2020 at 11:34
Solved
new Date(parseInt(data.Result[item].Date.substr(6)))
Explore related questions
See similar questions with these tags.
lang-js