The MSDN documentation for datetime recommends using datetime2 .
(datetime的MSDN文档建议使用datetime2 。)
Here is their recommendation: (以下是他们的建议:)
Use the time
, date
, datetime2
and datetimeoffset
data types for new work.
(使用time
, date
, datetime2
和datetimeoffset
数据类型进行新工作。)
These types align with the SQL Standard. (这些类型与SQL标准一致。)
They are more portable. (它们更便携。)
time
, datetime2
and datetimeoffset
provide more seconds precision. (time
, datetime2
和datetimeoffset
提供更多的秒精度。)
datetimeoffset
provides time zone support for globally deployed applications. (datetimeoffset
为全局部署的应用程序提供时区支持。)
datetime2 has larger date range, a larger default fractional precision, and optional user-specified precision.
(datetime2具有更大的日期范围,更大的默认小数精度和可选的用户指定精度。)
Also depending on the user-specified precision it may use less storage. (此外,根据用户指定的精度,它可能使用较少的存储空间。)
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…