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