I am developing some REST API’s which are returning data in json format. ASP.net will serialize the data and the output will be something like this.
[
{
"DueDate": "/Date(1338316200000+0530)/",
"User": "XYZ"
}
]
Here I want to provide the date in a standard format(like C# datetime format). Even though there are many ways to format it in the javascript, I am not considering that. Is there any way to generate standard date format using json so that one who is accessing my API can use them without any formatting. Thanks..
That is how .Net serializes a DateTime obj, it’s the safest way for .Net to know you want to deserialize into a DateTime object rather than keep the string representation.
Why not just return a string formatted how you want it, or how your users expect.