C# Datetime转Utc时间戳Timestamp
作者:C/S框架网  发布日期:2017-10-12 17:06:41
  C# Datetime转Utc时间戳Timestamp

C# Code:

/// <summary>
/// 返回时间戳,秒
/// </summary>
/// <param name="time"></param>
/// <returns></returns>
public static long getUtcTrick(DateTime time)
{
   DateTimeOffset fs = new DateTimeOffset(time);
   long trick = (fs.UtcTicks - 621355968000000000) / 10000000;//秒值
   return trick;
}

//来源:C/S框架网(www.csframework.com) QQ:23404761


上一篇 下一篇