Date Conversions?

Sep 30, 2008 at 8:15 PM
Hello,

I am pretty new to JSON.net and don't do too much with it other than use the  JavaScriptConvert.SerializeObject(myBizObject) method call.  I am having a problem with a date conversion.  I have the date sitting in a DateTime property of my business object with a value of {9/30/2008 12:00:00 AM}.  After the above serialization call the JSON object has the following property: OrderDate :new Date(1222732800000), which in turn translates to the following on the client after decoded "Mon Sep 29 20:00:00 EDT 2008".

What is going on here?  How can 9/30/2008 translate to 9/29/08 under any circumstance?

Thanks for the help.

Sep 30, 2008 at 10:43 PM
I'm getting confused with the versions available and which one to use.  I am using .Net 2.0...what is the latest version of JSON.net that I can use?

Trying to get better date conversion handling that what is in 1.3.1, and all the references I see on how to fix it (JavascriptDateTimeConverter) seem like they are only available in the 2.0 release and up...which requires a framework upgrade and I'm not sure that I can do that for this client.

Thanks for any help,
Randy
Oct 1, 2008 at 6:54 PM
I have since upgraded the project to JSON.Net 3.0 and used the new JavascriptDataTimeConverter attribute on the .Net object and this fixed the problem.  thanks!  Not sure what people will do when they do not have the luxury of upgrading the framwork though :)