BridgeStack.UnixDateTimeHelpers.ToUnixDate C# (CSharp) Метод

ToUnixDate() публичный статический Метод

Parses a DateTime into it's long representation in Unix Date format.
public static ToUnixDate ( this self ) : long
self this The DateTime object to parse.
Результат long
        public static long ToUnixDate(this DateTime self)
        {
            if (self == DateTime.MinValue)
            {
                return 0;
            }
            DateTime epoch = new DateTime(1970, 1, 1);
            TimeSpan delta = self - epoch;
            if (delta.TotalSeconds < 0)
            {
                throw new ArgumentOutOfRangeException(Error.InvalidUnixEpochErrorMessage);
            }
            return (long)delta.TotalSeconds;
        }
UnixDateTimeHelpers