csharp unix timestamp code example Example: c# unix timestamp var unixTimestamp = DateTimeOffset.UtcNow.ToUnixTimeSeconds();