According to Microsoft's page on the datetimeoffset
data type (see here):
根据微软关于datetimeoffset数据类型的页面(见这里):
A time zone offset specifies the zone offset from UTC for a time or datetime value.
时区偏移量指定时间或日期时间值与UTC的区域偏移量。
But nowhere does it say whether the datetime part of the datetimeoffset
string literal format is showing either:
但是它没有说明datetimeoffset字符串文字格式的日期时间部分是否显示:
- UTC time, with the timezone offset being what to apply to that time to get to localtime, or;
- localtime, with the timezone offset being what to apply to that time to get back to UTC.
UTC时间,时区偏移量适用于到达本地时间的时间,或者;
localtime,时区偏移量是应用于返回UTC的时间。
This is the string literal format for datetimeoffset: YYYY-MM-DD hh:mm:ss[.nnnnnnn] [{+|-}hh:mm]
.
这是datetimeoffset的字符串文字格式:YYYY-MM-DD hh:mm:ss [.nnnnnnn] [{+ | - } hh:mm]。
My question therefore is, is the YYYY-MM-DD hh:mm:ss[.nnnnnnn]
bit of that string literal in localtime or in UTC?
因此,我的问题是,本地时间或UTC中的字符串文字的YYYY-MM-DD hh:mm:ss [.nnnnnnn]位是什么?
1 个解决方案
#1
3
The YYY-MM-DD hh:mm:ss[.nnnnnnn] [{+|-}hh:mm] format is an ISO8601 format. The ISO page gives
YYY-MM-DD hh:mm:ss [.nnnnnnn] [{+ | - } hh:mm]格式是ISO8601格式。 ISO页面给出
Coordinated universal time (UTC)
Local time with offset to UTC协调世界时(UTC)与UTC的偏移的本地时间
As this format has the offset then the base time is local. See wikipedia for other examples.
由于此格式具有偏移,因此基准时间是本地的。有关其他示例,请参阅*。
#1
3
The YYY-MM-DD hh:mm:ss[.nnnnnnn] [{+|-}hh:mm] format is an ISO8601 format. The ISO page gives
YYY-MM-DD hh:mm:ss [.nnnnnnn] [{+ | - } hh:mm]格式是ISO8601格式。 ISO页面给出
Coordinated universal time (UTC)
Local time with offset to UTC协调世界时(UTC)与UTC的偏移的本地时间
As this format has the offset then the base time is local. See wikipedia for other examples.
由于此格式具有偏移,因此基准时间是本地的。有关其他示例,请参阅*。