Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In the REST services I have created I have set a date field to DateTime datatype like this :
[DataMember]
public DateTime Date{get;set;}

Now when returning JSON response I cant view it.I am getting error "The webpage is not available" error in chrome..This is only because of DateTime isssues. But when I see for XML response it is returning perfectly..In the XML response I can c the Date as
<date>0001-01-01T00:00:00 as response when the date returned is null value.

My question is I want JSON response when the datatype is DateTime only.But I don't want to change that datatype to string which when changed returns JSON response perfectly.. At any cost I should not change DateTime datatype ...How to get my output in JSON ?

Any help would be greatly appreciated.....

Thanks in advance....
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900