In SQL Server 2008 R2, I have the following T-SQL code:
SELECT CAST(GETDATE() AS DATETIMEOFFSET);
This gives me the result as shown below:
2011-12-26 10: 21: 13.7970000 +00: 00
But I wanted to be the result. It should be like this:
2011-12-26 10: 21: 13.7970000 +02: 00
Here are my date and time settings:
The same thing happens when I insert a value:
DECLARE @foo AS TABLE( fooDate DATETIMEOFFSET ); INSERT @foo VALUES(GETDATE()); SELECT * FROM @foo;
This gives me the same wrong result (at least the wrong one for my needs).
What am I missing here?
tugberk
source share