Json Datetime issue

Possible Duplicate:
how to force netwtonsoft json serializer to serialize datetime property to string?

I am using Newtonsoft.Json to convert my object in to JSon file. But i am having issue with the DateTime, in my object datetime field is set as "7/30/2012 8:29:12 PM" but in Json file i am getting datetime field in this format "/Date(1343660352227+0530)/"

i need to get the datetime in the same format as that of the object. is it possible?what should i do in order to get the same format?


I got the solution as follow.

JsonConvert.SerializeObject(this, Formatting.None, new IsoDateTimeConverter() {
    DateTimeFormat = "yyyy-MM-dd hh:mm:ss"
});

Here is the answer:

how to force netwtonsoft json serializer to serialize datetime property to string?

链接地址: http://www.djcxy.com/p/8154.html

上一篇: 如何转换此日期格式:/日期(1268524800000)/?

下一篇: Json Datetime问题