public string GetTime(DateTime dt)
{
Int64 retval = 0;
DateTime st = new DateTime(1970, 1, 1);
TimeSpan t = (dt.ToUniversalTime() - st);
retval = (Int64)(t.TotalMilliseconds + 0.5);
return retval.ToString();
}
转载于:https://www.cnblogs.com/sunzhenyong/p/4056899.html