gpt4 book ai didi

c# - 如何将 DateTime 值转换为 double 值?

转载 作者:行者123 更新时间:2023-11-30 19:04:14 26 4
gpt4 key购买 nike

如何将 DateTime 值转换为 double

最佳答案

如果 double 是指 OLE 自动化日期,那么您可以使用 DateTime.ToOADate() .来自链接的 MSDN 主题:

An OLE Automation date is implemented as a floating-point number whose value is the number of days from midnight, 30 December 1899. For example, midnight, 31 December 1899 is represented by 1.0; 6 A.M., 1 January 1900 is represented by 2.25; midnight, 29 December 1899 is represented by -1.0; and 6 A.M., 29 December 1899 is represented by -1.25.

The base OLE Automation Date is midnight, 30 December 1899. The maximum OLE Automation Date is the same as MaxValue, the last moment of 31 December 9999.

如果您正在谈论也可以存储在 double 中的一些其他日期表示,请指定...

关于c# - 如何将 DateTime 值转换为 double 值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1010697/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com