/// <summary>
/// 获取北京时间时间戳
/// </summary>
public static long GetBeiJingTimestamp(DateTime? dateTime)
{
if (dateTime == null)
{
return 0;
}
DateTime dt = new DateTime(1970, 1, 1, 0, 0, 0, 0);
var timestampMillisecond = (dateTime.Value.Ticks - dt.Ticks) / 10000;
var timestampSecond = Math.Round(Convert.ToDouble(timestampMillisecond / 1000));
timestampSecond -= 28800;
return Convert.ToInt64(timestampSecond);
}