C#時間戳轉化爲DateTime



public DateTime GetDateTime(string strLongTime) { Int64 begtime = Convert.ToInt64(strLongTime) * 10000000;//100毫微秒爲單位,textBox1.text需要轉化的int日期 DateTime dt_1970 = new DateTime(1970, 1, 1, 8, 0, 0); long tricks_1970 = dt_1970.Ticks;//1970年1月1日刻度 long time_tricks = tricks_1970 + begtime;//日誌日期刻度 DateTime dt = new DateTime(time_tricks);//轉化爲DateTim return dt; }

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章