Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
14 lines (12 sloc) 352 Bytes
using System;
namespace DontMergeMeYet.Extensions
{
static class DateTimeExtensions
{
private static readonly DateTime UnixEpoch = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public static int ToUnixTimeStamp(this DateTime date)
{
return (int) (date - UnixEpoch).TotalSeconds;
}
}
}