
IsDST function for SQL Server
I've seen my share of in-house logics to detect if a given day falls under daylight saving time or not, and the conclusion I've come to is this; (A) if you can get away without having to use IsDST() function, that probably is a better way to go, but (B) if you must, don't compute, use lookup. Without further ado, here is our standard IsDST function that we can't tune any faster. CREATE function [dbo].[IsDST] (@localTime datetime) returns bit as /* SATO Database Architects LLC