原创

C# Long to datetime

CreateDateTime = ConvertLongToDateTime(long.Parse(jt[j]["createdate"].ToString())).ToString(),
          private static DateTime ConvertLongToDateTime(long d)
        {

            DateTime dtStart = TimeZone.CurrentTimeZone.ToLocalTime(new DateTime(1970, 1, 1));
            long lTime = long.Parse(d + "0000");
            TimeSpan toNow = new TimeSpan(lTime);
            DateTime dtResult = dtStart.Add(toNow);
            return dtResult;
        }
正文到此结束
该篇文章的评论功能已被站长关闭
本文目录