Date in Json is in format "Modified":"\/Date(1570680000000)\/" How to convert back to regular date?

Date in Json is in format "Modified":"\/Date(1570680000000)\/" How to convert back to regular date?

jocasiojocasio Posts: 1Questions: 1Answers: 0

I am using MVC5 and created an ActionResult to return JSON. The problem is my dates are formatted as \/Date(1570680000000)\/. What do I do to get this date to be a regular date?

Answers

  • allanallan Posts: 63,213Questions: 1Answers: 10,415 Site admin

    Best option is to render your DateTime instant on the server-side using .NET’s date / time formatters - send an ISO8601 string to the client-side. Failing that you’d need to use a client-side renderer to convert it into something human readable.

    Allan

This discussion has been closed.