How to get time in c #?

Possible duplicate:
How do you convert era time to C #?

I am trying to figure out how to get an era time in C #. Similar to the time stamps indicated on this website: http://www.epochconverter.com/

Does the DateTime method have this for this?

+58
c # datetime epoch
Feb 26 '12 at 12:33
source share
1 answer
TimeSpan t = DateTime.UtcNow - new DateTime(1970, 1, 1); int secondsSinceEpoch = (int)t.TotalSeconds; Console.WriteLine(secondsSinceEpoch); 
+115
Feb 26 2018-12-12T00:
source share



All Articles