Solved

Converting serialized dates using c#

Posted on 2012-03-30
4
262 Views
Last Modified: 2012-03-30
Hi All,

For example, I have a serialized date as the following integer 1109808000000 which actually works out to be March 5th 2005...

Could anyone suggest how I can convert this serialized date to display as its human readable form using c#?

Many thanks,

Rit
0
Comment
Question by:rito1
  • 2
4 Comments
 
LVL 6

Accepted Solution

by:
ingriT earned 250 total points
ID: 37786350
Have you tried this http://stackoverflow.com/questions/6554407/deserialize-date1309498021672-in-to-datetime?

var serializer = new System.Web.Script.Serialization.JavaScriptSerializer();
string json = "\"\\/Date(1309498021672)\\/\"";
DateTime date = serializer.Deserialize<DateTime>(json);
// date is 7/1/2011 5:27:01 AM

Open in new window

0
 
LVL 6

Expert Comment

by:ingriT
ID: 37786369
And if you're using .NET 4.0 and you don't have System.Web.Script.Serialization.JavaScriptSerializer(); available, set the Target framework in your project properties to ".NET Framework 4" and not the Client framework and then add the System.Web.Exetensions dll as a reference.
0
 
LVL 6

Assisted Solution

by:kswathi
kswathi earned 250 total points
ID: 37786374
If you are using Pr time

Check the below link hope it helps

http://stackoverflow.com/questions/56638/how-to-convert-from-prtime-to-net-datetime
0
 
LVL 1

Author Closing Comment

by:rito1
ID: 37786382
Excellent thanks, that gives me food for thought.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question