How to convert Unix Time to .net DateTime
This article explains how to convert UNIX Datetime to .Net DateTime in local format.
Article Metadata
Compatibility
Platform(s): Windows Phone 7.5
Article
Created: nilay.shah3nov
(26 Aug 2012)
Last edited: hamishwillee
(30 Nov 2012)
UNIX Time
Unix time, or POSIX time, is a system for describing instances in time, defined as the number of seconds that have elapsed since midnight Coordinated Universal Time (UTC), January 1, 1970, not counting leap seconds. It is used widely in Unix-like and many other operating systems and file formats. It is neither a linear representation of time nor a true representation of UTC. Unix time may be checked on some Unix systems by typing date +%s on the command line.
How to Convert Unix Time to .Net System.DateTime
System.DateTime unixTime = new System.DateTime(1970,1,1,0,0,0,0, DateTimeKind.Utc);
DateTime myDate =unixTime.AddSeconds(1258598728).toLocalTime();

