Over a million developers have joined DZone.

Get The Unix Epoch Time In One Line Of C#

One line of C#, so much awesomeness: The Unix epoch time.

· Java Zone

Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code! Brought to you in partnership with ZeroTurnaround.


int epoch = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;


The Java Zone is brought to you in partnership with ZeroTurnaround. Check out this 8-step guide to see how you can increase your productivity by skipping slow application redeploys and by implementing application profiling, as you code!

Topics:
java,c#,unix,epoch time

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}