Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17


datetimeoffset(5)) ?

Posted on 2011-03-23
Medium Priority
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
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
  • 3
  • 2
LVL 60

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 1400 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.
 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks


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 1400 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…

661 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