How to subtract a datetime from another datetime?

后端 未结 7 928
借酒劲吻你
借酒劲吻你 2020-12-03 20:36

How do I subtract two DateTime values from another DateTime value and have the result saved to a double?

7条回答
  •  不知归路
    2020-12-03 21:22

    Use DateTime.Subtract which will return TimeSpan , then use TotalSeconds property of the result which is of type double.

提交回复
热议问题