SystemExt/Extensions/System.DateTime.cs
/// <summary>
/// Converts a <see cref="DateTime"/> to an <see cref="Int64"/> which represents the number
/// of seconds since the UNIX epoch.
/// </summary>
/// <param name="self">
/// An instance of the <see cref="DateTime"/> class.
/// </param>
/// <returns>
/// The number of seconds between the UNIX epoch and the specified <see cref="DateTime"/>.
/// </returns>
Converts a  to an  which represents the number
of seconds since the UNIX epoch.
Converts a to an which represents the number of seconds since the UNIX epoch .
public static long ToUnixTime(this DateTime self)
        {
            var timeSpan = self.Subtract(Constants.UnixEpoch);
            return (long)timeSpan.TotalSeconds;
        }
public static long ToUnixTime ( this DateTime self ) { var timeSpan = self . Subtract ( Constants . UnixEpoch ) ; return ( long ) timeSpan . TotalSeconds ; }
Converts a  to an  which represents the number
of seconds since the UNIX epoch.
Converts a to an which represents the number of seconds since the UNIX epoch .
The number of seconds between the UNIX epoch and the specified .
The number of seconds between the UNIX epoch and the specified .
DateTime
this
self
An instance of the  class.
An instance of the class .