O'Reilly logo
  • Max Bixente thinks this is interesting:


T-SQL supports two functions related to date and time values with an offset: SWITCHOFFSET and TODATETIMEOFFSET.

With the SWITCHOFFSET function, you can return an input DATETIMEOFFSET value in a requested offset term. For example, consider the expression SWITCHOFFSET(SYSDATETIMEOFFSET(), ‘-08:00’). Regardless of the offset of the instance you are connected to, you request to present the current date and time value in terms of offset ‘-08:00’. If the system’s offset is, ...