RawSushi's Tech Journal
My online tech scrapbook where I keep my notes in case I need to look them up later
Tuesday, March 12, 2013
C# Getting Time Since Epoch
Many things are simpler in C# than e.g. in Java, but getting the Epoch time is an exception, and this is how it's done.
TimeSpan timeSpan = DateTime.UtcNow - new DateTime(1970, 1, 1);
double currentTime = timeSpan.TotalSeconds;
No comments:
Post a Comment
Newer Post
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment