Make sure you are not using an older version of .NET such as 4.5. In older versions, System.DateTimeOffset does not contain the ToUnixTimeSeconds () method.
If so, and upgrading the .NET platform to a newer version will not change anything, this should solve the problem.
source share