标签:datetime alt .text task ext summary div pre 时间戳
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Common { public class DateUtils { /// <summary> /// 时间转换为Unix时间戳 /// </summary> /// <param name="date"></param> /// <returns></returns> public static int DateConvertToInt(DateTime date) { DateTime newDate = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970,1,1)); return (int)(date - newDate).TotalSeconds; } } }
标签:datetime alt .text task ext summary div pre 时间戳
原文地址:http://www.cnblogs.com/Jacob-Wu/p/6233116.html