tags:

views:

24

answers:

2

I would like to know which format SQL Server saves datetimes, GMT or UMT?

A: 

Neither, it just returns the values in a specific format but stores it in a format without a timezone.

BitOff
+3  A: 

The default DATETIME value in SQL Server has no knowledge of time zones and thus doesn't really care about time zones - that's entirely up to you to manage.

DECLARE @MyDate DATETIME
SET @MyDate = '20100922 04:05:06'   --- no information on timezone 

See MSDN docs on DATETIME.

With SQL Server 2008, a new data type was introduced called DATETIMEOFFSET which stores time along with a timezone offset. So here, you can store the local time and store the timezone that time is local to as well.

DECLARE @MyDateOffset DATETIMEOFFSET
SET @MyDateOffset = '20100922 04:05:06 +09:00'  -- UTC plus 9 hours
marc_s