c# timestamp转换datetime
2021-07-03 07:09
标签:ble dtd des date ring addm [] pre 分享 c# timestamp转换datetime 标签:ble dtd des date ring addm [] pre 分享 原文地址:https://www.cnblogs.com/YaoFrankie/p/9899818.html一、Codes
class Program
{
static void Main(string[] args)
{
var result = UnixTimeStampToDateTime(1497528525420);
}
public static DateTime UnixTimeStampToDateTime(double unixTimeStamp)
{
var dtDateTime = new DateTime(1970, 1, 1, 0, 0, 0, 0, DateTimeKind.Utc);
dtDateTime = dtDateTime.AddMilliseconds(unixTimeStamp).ToLocalTime();
return dtDateTime;
}
}
二、Result