标签:
/// <summary> /// 获取当前时间戳 /// </summary> /// <param name="bflag">为真时获取10位时间戳,为假时获取13位时间戳.</param> /// <returns></returns> public static string getTimeStamp(bool bflag = true) { TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); string ret = string.Empty; if (bflag) ret = Convert.ToInt64(ts.TotalSeconds).ToString(); else ret = Convert.ToInt64(ts.TotalMilliseconds).ToString(); return ret; }
标签:
原文地址:http://www.cnblogs.com/zhangshuoyt/p/4434227.html