Zhao Tian 博客

C# 获取时间戳

2017-12-30 13:28:54


/// <summary> 
/// 获取时间戳 
/// </summary> 
/// <returns></returns> 
public static string GetTimeStamp() 
{ 
    TimeSpan ts = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0); 
    return Convert.ToInt64(ts.TotalSeconds).ToString(); 
}

修改时间 2017-12-30 14:42:37| 阅读(41) |评论(0) |返回首页

评论