SQL 服务器 / SQL 中 datetimeoffset 数据类型的字符长度是多少?

What is the character length of datetimeoffset datatype in SQL Server / SQL?

您能否解释一下 SQL 服务器中的 (YYYY-MM-DD hh:mm:ss {+|-}hh:mm) 格式在 datetimeoffset 数据类型中为何有 26 个字符? hh:mm:ss{+|-}hh:mm 之间是否有 space?

是的,第28位有一个space:

declare @o datetimeoffset;

select @o = getdate()

select 
    @o as [value], 
    len(convert(varchar(36), @o)) as [length],
    substring(convert(varchar(36), @o), 28, 1) as [27th character],
    ascii(substring(convert(varchar(36), @o), 28, 1)) as [27th character ascii]

结果:

value                               | length | 27th character | 27th character ascii
2017-10-24 09:18:36.0466667 +00:00  |  34    |                | 32