I am wondering if .NET contains a method to convert the current time in seconds or milliseconds to a UNIX timestamp (offset from 1970/1/1)?
TimeSpan t = (DateTime.UtcNow - new DateTime(1970, 1, 1)); Console.WriteLine((int)t.TotalSeconds);