Web developers wiki ASP.NET Sitecore Sharepoint Kentico by Evident Interactive

convert UnixTime to DateTime

Modified: 2008/11/18 10:49 by Pieter Brinkman - Categorized as: ASP.NET

In an RSS feed I only had an UnixTime. For presentation I needed to convert this string to datetime. I did this with this code

DateTime itemDateTime = new DateTime(1970, 1, 1, 0, 0, 0).AddSeconds(item.unixTime); 

Source: blog.newguid.net

 © Evident Interactive BV