timestamp c# code example
Example 1: unix time c#
Int32 unixTimestamp = (Int32)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1))).TotalSeconds;
Example 2: c# datetime now timestamp
String timeStamp = GetTimestamp(DateTime.Now);
Example 3: c# datetime now timestamp
var Timestamp = new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds();
Example 4: c# timestamp now
DateTime now = DateTime.Now;
Console.WriteLine("NOW: " + now);