Saturday, May 30, 2009

Get the Unix Epoch time in C#

// Get the Unix Epoch time in C#

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

No comments:

Post a Comment