DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Greg has posted 3 posts at DZone. View Full User Profile

Get The Unix Epoch Time In One Line Of C#

  • submit to reddit
int epoch = (int)(DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;