Solved

Converting serialized dates using c#

Posted on 2012-03-30
4
253 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

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now