BitSharper.Common.UnixTime.ToUnixTime C# (CSharp) Method

ToUnixTime() public static method

Converts a DateTime to unix time. Unix time is the number of seconds between 1970-1-1 0:0:0.0 (unix epoch) and the time (UTC).
public static ToUnixTime ( System.DateTime time ) : ulong
time System.DateTime The date time to convert to unix time
return ulong
        public static ulong ToUnixTime(DateTime time)
        {
            return (ulong) (time.ToUniversalTime() - _unixEpoch).TotalSeconds;
        }