Convert DateTime to long and also the other way around

前端 未结 7 820
遥遥无期
遥遥无期 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:14

    To long from DateTime:

    long DateTime.Ticks

    To DateTime from long:

    new DateTime(long)

    0 讨论(0)
提交回复
热议问题