Skip to main content
added 628 characters in body
Source Link
LowlyDBA - John M
  • 11k
  • 11
  • 45
  • 62

Yes, it accounts for it:

AT TIME ZONE applies specific rules for converting input values in smalldatetime, datetime and datetime2 data types, that fall into an interval that is affected by the DST change

As per the MSDN article on the expression. The sys.time_zone_info column supplies information on if the zone currently is in DST, but the article above indicates that the rules take into account DST given a specific date time value.

Example:

/*------------------------
SELECT SYSUTCDATETIME() AT TIME ZONE 'Eastern Standard Time';
------------------------*/

----------------------------------
2017-01-18 22:18:12.3789253 -05:00

And when we try using a date with a different DST offset:

/*------------------------
SELECT CAST('2017-07-18' AS DATETIME) AT TIME ZONE 'Eastern Standard Time';
------------------------*/

----------------------------------
2017-07-18 00:00:00.000 -04:00

It assigns a different DST offset value, being aware of whether or not the date falls into DST.

Yes, it accounts for it:

AT TIME ZONE applies specific rules for converting input values in smalldatetime, datetime and datetime2 data types, that fall into an interval that is affected by the DST change

As per the MSDN article on the expression. The sys.time_zone_info column supplies information on if the zone currently is in DST, but the article above indicates that the rules take into account DST given a specific date time value.

Yes, it accounts for it:

AT TIME ZONE applies specific rules for converting input values in smalldatetime, datetime and datetime2 data types, that fall into an interval that is affected by the DST change

As per the MSDN article on the expression. The sys.time_zone_info column supplies information on if the zone currently is in DST, but the article above indicates that the rules take into account DST given a specific date time value.

Example:

/*------------------------
SELECT SYSUTCDATETIME() AT TIME ZONE 'Eastern Standard Time';
------------------------*/

----------------------------------
2017-01-18 22:18:12.3789253 -05:00

And when we try using a date with a different DST offset:

/*------------------------
SELECT CAST('2017-07-18' AS DATETIME) AT TIME ZONE 'Eastern Standard Time';
------------------------*/

----------------------------------
2017-07-18 00:00:00.000 -04:00

It assigns a different DST offset value, being aware of whether or not the date falls into DST.

Source Link
LowlyDBA - John M
  • 11k
  • 11
  • 45
  • 62

Yes, it accounts for it:

AT TIME ZONE applies specific rules for converting input values in smalldatetime, datetime and datetime2 data types, that fall into an interval that is affected by the DST change

As per the MSDN article on the expression. The sys.time_zone_info column supplies information on if the zone currently is in DST, but the article above indicates that the rules take into account DST given a specific date time value.