Reputation: 65137
How to convert UTC time in UNIX time format to a normal DateTime format (that I could read)?
Example of UTC Time in UNIX time format 1292985942
Upvotes: 1
Views: 1697
Reputation: 3967
You can do it in perl like this
my @temp_var = split(/ /,localtime(1292985942));
Output would be
$temp_var[0] => Wed $temp_var[1] => Dec $temp_var[2] => 22 $temp_var[3] => 10:45:42 $temp_var[4] => 2010
Upvotes: -2
Reputation: 4716
double timestamp = 1292985942;
DateTime dateTime = new System.DateTime(1970, 1, 1, 0, 0, 0, 0);
dateTime = dateTime.AddSeconds(timestamp);
Upvotes: 6