Pieter Brinkman Blog

convert UnixTime to DateTime

1 min readpieterASP.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

[code:c#]

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

[/code]

No idea what it does but it works :D