请问您能解释一下(YYYY-MM-DD hh:mm:ss {+|-}hh:mm
)格式在SQL Server中的datetimeoffset数据类型中有26个字符吗? hh:mm:ss
和{+|-}hh:mm
之间是否有空格?
答案 0 :(得分:1)
是的,28号位置有一个空格:
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