Menu

SQL Server DATETIMEOFFSET Data Type

SQL Server DATETIMEOFFSET combines a date and time with an offset from Coordinated Universal Time (UTC). SQL Server processes and compares the value in UTC while preserving the supplied offset for retrieval. The offset is not a time-zone name and does not carry daylight-saving rules.

Syntax

DATETIMEOFFSET [ ( fractional_seconds_precision ) ]

fractional_seconds_precision can be from 0 through 7 and defaults to 7 (100-nanosecond precision). The date range is January 1, 0001, through December 31, 9999. The offset ranges from -14:00 through +14:00.

Example

Store a local date/time with its offset, then display the same instant at UTC:

DECLARE @event_time DATETIMEOFFSET(0) = '2026-09-29T09:30:00+08:00';

SELECT @event_time AS stored_value,
       SWITCHOFFSET(@event_time, '+00:00') AS utc_value;

The stored value preserves +08:00; SWITCHOFFSET changes the displayed offset to +00:00 without changing the UTC instant. For example, this value represents 2026-09-29 01:30:00 +00:00.

DATETIMEOFFSET and time-zone rules

DATETIMEOFFSET preserves a numeric offset, not a named time zone such as Pacific Standard Time. If a local wall-clock value must follow a named zone’s daylight-saving rules, use AT TIME ZONE. To change the displayed offset of an existing DATETIMEOFFSET while preserving its instant, use SWITCHOFFSET.

For a combined date/time value without an offset, see DATETIME2. Microsoft documents the full DATETIMEOFFSET type.