'DateTime'和'DateTimeOffset'之间的区别 [英] Difference between 'DateTime' and 'DateTimeOffset'
问题描述
在 DateTime
和 DateTimeOffset
对象之间有什么区别?
What is difference between a DateTime
and a DateTimeOffset
object?
我们什么时候应该使用每一个?
And when should we use each one?
在可能更改服务器区域的Web应用程序中,存储日期和时间。哪一个更好,还是有其他建议?
In a web-application that may change the server's area, storing date and time. Which one is better, or is there any other suggestions?
推荐答案
DateTimeOffset表示一个时间点,通常表示为相对于协调世界时(UTC)的日期和时间它提供比DateTime结构更大程度的时区感知。请参阅这里 - http://msdn.microsoft.com/en-us/library /bb546101.aspx 。
DateTimeOffset Represents a point in time, typically expressed as a date and time of day, relative to Coordinated Universal Time (UTC) it provides a greater degree of time zone awareness than the DateTime structure. See it here- http://msdn.microsoft.com/en-us/library/bb546101.aspx.
这篇关于'DateTime'和'DateTimeOffset'之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!