各种时间戳及用途
(一)
/// <summary>
/// 获得距离1970-01-01的毫秒数
/// </summary>
/// <param name="newDate">时间参数</param>
/// <returns></returns>
public static long GetMilliSecond(DateTime newDate)
{
DateTime oldDate = new DateTime(1970, 1, 1);
// Difference in days, hours, and minutes.
TimeSpan ts = newDate.ToUniversalTime() - oldDate;
return (long)ts.TotalMilliseconds;
}