?
Solved

Converting serialized dates using c#

Posted on 2012-03-30
4
Medium Priority
?
268 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 1000 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 1000 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Is your data getting by on basic protection measures? In today’s climate of debilitating malware and ransomware—like WannaCry—that may not be enough. You need to establish more than basics, like a recovery plan that protects both data and endpoints.…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses

864 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