convert UnixTime to DateTime

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

[code:c#]

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

[/code]

 

No idea what it does but it works šŸ˜€

Leave a Reply

Your email address will not be published.