I am currently using this code:
var stringSecsNow = DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1)).TotalSeconds.ToString();
But is there some other way. I seem to recall in another language that there was an easier way to do this?
Almost same but looks easier.
DateTime PreviousDateTime = new DateTime(1970, 1, 1);
var stringSecsNow = (DateTime.UtcNow - PreviousDateTime).TotalSeconds.ToString();