Convert DateTime to long and also the other way around

前端 未结 7 847
遥遥无期
遥遥无期 2020-12-05 09:29

I want to store dates as numbers in a table. I know how to do that but I don\'t know how to go back. How can I cast a long variable to ToDateTime.

DateTime n         


        
7条回答
  •  渐次进展
    2020-12-05 10:05

    From long to DateTime: new DateTime(long ticks)

    From DateTime to long: DateTime.Ticks

提交回复
热议问题