Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions

datetimeoffset(5)) ?

Posted on 2011-03-23
Last Modified: 2012-05-11
which means?
    CAST(GETDATE() AS datetimeoffset(5)) AS 'datetimeoffset'

2011-03-23 15:20:23.67000 +00:00
Question by:enrique_aeo
  • 3
  • 2
LVL 59

Expert Comment

by:Kevin Cross
ID: 35202308

What is your question with regards to the above?


Author Comment

ID: 35202375
datetimeoffset(1)) ?
datetimeoffset(2)) ?
datetimeoffset(3)) ?
datetimeoffset(4)) ?

WHY I have no time difference to UTC?
LVL 23

Accepted Solution

wdosanjos earned 350 total points
ID: 35202531
datetimeoffset is a date/time data type that is time zone aware.  The value that goes in the parenthesis determines the precision.

Your sample code just casts GETDATE() to datetimeoffset, but since GETDATE() only returns datetime the time zone part is not set (remains +00:00).

You should use the SYSDATETIMEOFFSET() to get your current time in datetimeoffset format:


More info here:

I hope this helps.
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.


Assisted Solution

enrique_aeo earned 0 total points
ID: 35237824
ok, i execute
this is the results
2011-03-28 21:26:53.1630585 -05:00

what is the main means?
LVL 23

Assisted Solution

wdosanjos earned 350 total points
ID: 35237869
-05:00 means that your system is 5 hours behind GMT.

Author Closing Comment

ID: 35308392
it is fine

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Linked Server Issue with SQL2012 3 28
Problem when I run a simple storeproc - help 4 23
Stored Proc - Rewrite 42 59
SQL Database Restore 2008 R2 1 12
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
SQL Server engine let you use a Windows account or a SQL Server account to connect to a SQL Server instance. This can be configured immediatly during the SQL Server installation or after in the Server Authentication section in the Server properties …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question