WorldofASP.NET : ASP.NET Directory, Tutorial, Hosting, and Source Code
You are 1 of 242 users


AjaxPro JSON Parser and Dates

Blogger : Ajax.NET Professional - AJAX and JSON made easy!
All posts : All posts by Ajax.NET Professional - AJAX and JSON made easy!
Category : ASP.NET
Blogged date : 2006 Sep 22

Because there are a lot of developers using the stand-alone JSON parser (which is included in the release package of AjaxPro) I decided today to serialize the .NET data type System.DateTime with the UniversalSortableDateTimePattern (yyyy'-'MM'-'dd HH':'mm':'ss'Z') as a simple string. You can use this string as input value, too, it will be parsed to an .NET System.DateTime.

Below you will find an example how to use the different JSON outputs in a simple ConsoleApplication:

JavaScriptSerializer.Serialize(DateTime.Now)  JavaScriptDeserializer.DeserializeFromJson<DateTime>(json)  UniversalSortableDateTimePattern 

The output will be similar to this:

"2006-09-22 09:49:18Z"
22.09.2006 09:49:18
22.10.2006 12:00:00
23.07.1977 03:13:49
20.09.2006 12:23:02
 

 Note: when using AjaxPro for ASP.NET web application you will still get the JavaScript Date object.

Share this post: Email it! | bookmark it! | digg it! | reddit!

Read comments or post a reply to : AjaxPro JSON Parser and Dates
Page 1827 of 1924
Next | Last

.NET News Categories








Legend : - Within 3 Days - Within 6 Days - Within 9 Days

Home | Add Resources | Sponsored Listings | Advertise with Us | SiteMap 1 | SiteMap 2 | Link To Us | Contact Us
© 2002-2008 Worldofasp.net ASP.NET Directory, Hosting and Tutorials | All rights reserved
Our Partners : ASP.NET Web Hosting | Windows Web Hosting | ASP.NET Hosting | Phone Card | PHP Directory | Bangkok Hotels |Calling Card