How to convert .NET DateTime to UNIX timestamp (as in PHP, etc.)
int timestamp = (DateTime.UtcNow - new DateTime(1970,1,1,0,0,0)).TotalSeconds
and convert a Unix timestamp to an ASP.NET DateTime value:
DateTime date = (new DateTime(1970,1,1,0,0,0)).AddSeconds(datestamp)