Hi I am writing a JSON webservice which returns DateTime.
It is returning the date time in EPOCH format. Is it possible to modify the JSON date format it returns.
Code snippet
[ServiceContract]
public interface ITMAppServices
{
[OperationContract]
[WebGet(UriTemplate = "/Test",
RequestFormat = WebMessageFormat.Json,
ResponseFormat = WebMessageFormat.Json)]
DateTime GetData();
}
Actual implementaiton
public class TMAppServices : ITMAppServices
{
public DateTime GetData()
{
return DateTime.Now;
}
}
i am simply returning datetime.now in C#
Output in EPOCH format :
"/Date(1413399311687+0300)/"
i want output in same format returned by C# Or if I get datetime from SQL