AT TIME ZONE
assigns or converts a time zone offset
What changes
- Input
- a date/time expression and a time zone name
- Output or change
- datetimeoffset
- Return type
- Returns the data type of datetimeoffset.
Syntax at a glance
input_date AT TIME ZONE time_zone_value
Work example
A timestamp needs a named time-zone offset for a report or display boundary.
Use a known UTC instant and test a daylight-saving transition. Keep stored instants in UTC and convert at the display boundary.
Check your work AT TIME ZONE. The local offset and date match the named zone at that instant, including the transition rule.
Open Microsoft Learn for full syntax, permissions, and details for your version.