How to get the unix timestamp in C#?
To get Unix Timestamp in C# you can use below example.Example
using System;
public class Program
{
public static void Main()
{
Int32 unixTimestamp = (int)DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds;
Console.WriteLine(unixTimestamp);
}
}
Output
1644205260