c# from microsoft timestamp to date code example Example: c# datetime to timestamp DateTimeOffset.UtcNow.ToUnixTimeSeconds()