Dofactory.com
Dofactory.com
Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.

SQL TODATETIMEOFFSET Function

TODATETIMEOFFSET returns a datetimeoffset from the specified datetime.

The fractional precision is the same as the datetime value provided.

Example

#

This example returns a timezoneoffset with +8:00 for the specified date.

SELECT TODATETIMEOFFSET ('2022-09-28 8:54:16', '+08:00') 
       AS 'Datetime Offset'
Result:  1 record
Datetime Offset
2022-09-28 08:54:16.0000000 +08:00

Syntax

Syntax of the TODATETIMEOFFSET function .

TODATETIMEOFFSET(datetime, offset) 

datetime -- a datetime2 value or column name.

offset -- a timezone offset or signed integer representing from +14 to -14.


You may also like



Last updated on Dec 21, 2023

Earn income with your data and sql skills
Sign up and we'll send you the best freelance opportunities straight to your inbox.
We're building the largest freelancing marketplace for people like you.
By adding your name & email you agree to our terms, privacy and cookie policies.