The JSON specification lacks a standardized format for date exchange, leading to various date representation methods. Microsoft .NET Web APIs typically return JSON dates in a standardized format, yet older .NET framework versions may serialize C# datetime objects into unconventional string formats such as "/Date(1530144000000+0530)/" or "/Date(1530144000000)/". Notably, the numeric portion within these JSON Date strings signifies the count of milliseconds elapsed since January 1, 1970.
Then let's convert it to js format:
The substr() function takes out the /Date( part, and the parseInt() function gets the integer and ignores the )/ at the end. The resulting number is passed into the Date constructor .
ISO-8601 formatted JSON dates
For ISO-8601 formatted JSON dates, just pass the string into the Date constructor: