convert to timestamp c# code example
Example 1: c# datetime to timestamp
DateTimeOffset.UtcNow.ToUnixTimeSeconds()
Example 2: c# convert datetime to unix timestamp
Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;