📌  相关文章
📜  c# 以秒为单位的 Unix 时间转换为日期时间 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:50.245000             🧑  作者: Mango

代码示例1
public static DateTime UnixTimeStampToDateTime( double unixTimeStamp )
{
    // Unix timestamp is seconds past epoch
    System.DateTime dtDateTime = new DateTime(1970,1,1,0,0,0,0,System.DateTimeKind.Utc);
    dtDateTime = dtDateTime.AddSeconds( unixTimeStamp ).ToLocalTime();
    return dtDateTime;
}