How to convert a double value to a DateTime in c#?

后端 未结 5 1439
-上瘾入骨i
-上瘾入骨i 2021-01-01 23:33

I have the value 40880.051388 and am storing it as a double, if I open Excel and paste in a cell and apply the following custom format \"m/d/yyyy h:mm\" to that

5条回答
  •  不知归路
    2021-01-01 23:41

    Looks like you're using the old OLE Automation date. Use

    DateTime.FromOADate(myDouble)
    

提交回复
热议问题