Format from ticks to date

前端 未结 2 1156
故里飘歌
故里飘歌 2020-12-10 14:04

I am needing to transfer some logs which were timestamped in ticks to an XML document. I would prefer the timestamps to be more Specific such as \"July 14, 2009 10:18:04 pm\

2条回答
  •  长情又很酷
    2020-12-10 14:57

    If logText is a string, you can convert it to long (Int64) and use this constructor:

    DateTime date = new DateTime(long.Parse(logText));
    

提交回复
热议问题