将Datetime转换成时间戳,10位,秒
netnr 2018-11-03
/// <summary>
/// 将Datetime转换成时间戳,10位,秒
/// </summary>
/// <param name="datetime"></param>
/// <returns></returns>
public static long ToTimestamp(this DateTime datetime)
{
    return (datetime.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
}
登录写评论