Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
可返回从原始时区偏移转换到指定时区偏移的 TIMESTAMP WITH TIME ZONE 值。
SWITCHOFFSET( tmz-expression, time-zone-offset )
tmz-expression 要转换的 TIMESTAMP WITH TIME ZONE 值。
time-zone-offset 结果的时区偏移。该值可以是表示协调通用时间 (UTC) 前后分钟数的整数、{ + | - } hh:nn 形式的字符串或表示 Zulu 时区的 Z。Zulu 时区是与 UTC 相同的时区。
TIMESTAMP WITH TIME ZONE
SQL/2008 服务商扩充。
下例将时区偏移值从 -04:00 小时更改为 -07:00 小时。返回的值为 2009-04-03 11:45:12.123-07:00。
SELECT CAST ( '2009-04-03 14:45:12.123-04:00' AS datetimeoffset ) AS EDT, SWITCHOFFSET( EDT,'-07:00' ) AS PDT;