Determining remote daylight saving in sql server

后端 未结 4 1214
刺人心
刺人心 2020-12-21 01:07

I want to determine the if daylight saving time is active or not, but in a region different to where my server is located.

My problem is I want to check the dayligh

4条回答
  •  没有蜡笔的小新
    2020-12-21 01:52

    Here’s a crude IsDST for SQL Server…

    CAST((DATEPART(month, DATEADD(week, -1, )) + 2) % 13 / 5 AS bit) AS IsDST

    Yields 0 for Standard Time Nov 8 – Mar 7, and 1 for Daylight Time Mar 8 – Nov 7.

提交回复
热议问题