datetimeoffset(5)) ?

which means?
 SELECT
    CAST(GETDATE() AS datetimeoffset(5)) AS 'datetimeoffset'


datetimeoffset
2011-03-23 15:20:23.67000 +00:00
enrique_aeoAsked:
Who is Participating?
 
wdosanjosConnect With a Mentor Commented:
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:

     SELECT SYSDATETIMEOFFSET()

More info here:
http://msdn.microsoft.com/en-us/library/ms186724%28v=SQL.100%29.aspx

I hope this helps.
0
 
Kevin CrossChief Technology OfficerCommented:
enrique_aeo,

What is your question with regards to the above?

Kevin
0
 
enrique_aeoAuthor Commented:
datetimeoffset(1)) ?
datetimeoffset(2)) ?
datetimeoffset(3)) ?
datetimeoffset(4)) ?

WHY I have no time difference to UTC?
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
enrique_aeoConnect With a Mentor Author Commented:
ok, i execute
SELECT SYSDATETIMEOFFSET()
this is the results
2011-03-28 21:26:53.1630585 -05:00

what is the main means?
 -05:00
0
 
wdosanjosConnect With a Mentor Commented:
-05:00 means that your system is 5 hours behind GMT.
0
 
enrique_aeoAuthor Commented:
it is fine
0
All Courses

From novice to tech pro — start learning today.