.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Code Snippets >> DateTime >> Post New Resource Bookmark and Share   

 Subscribe to Code Snippets

Convert/Format Unix Timestamp to DateTime

Posted By:Pankaj Mishra       Posted Date: August 14, 2008    Points: 10    Category: DateTime    URL: http://www.dotnetspark.com  
 

Hi,

Below is the method to convert Unix Timestamp to .Net DateTime Format using C#.

public static DateTime FormatUnixTime(double timestamp)
{

DateTime startUnixTime = new DateTime(1970, 1, 1, 0, 0, 0, 0);

return startUnixTime.AddSeconds(timestamp);

}

Cheers
Pankaj
 


     

Further Readings:

Responses

No response found. Be the first to respond this post

Post Comment

You must Sign In To post reply
Find More code samples in C#, ASP.Net, Vb.Net and more Here

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend