Solved

Converting serialized dates using c#

Posted on 2012-03-30
4
264 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

705 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