1

Please can anyone help with a function or sql script that help to put British Summer Time changes into consideration in date column? You know UK time changes between the end of March and October. Clocks move forward an hour on the second Sunday of March and move back again on the first Sunday of November. Your help will be highly appreciated please

Jeje
  • 33
  • 10
  • Which dbms are you using? (date/time stuff are to often far from ANSI SQL compliant.) – jarlh Nov 30 '17 at 10:35
  • I'm using Microsoft SQL Server please – Jeje Nov 30 '17 at 11:01
  • Possible duplicate of [How to create Daylight Savings time Start and End function in SQL Server](https://stackoverflow.com/questions/19732896/how-to-create-daylight-savings-time-start-and-end-function-in-sql-server) – Gord Thompson Nov 30 '17 at 13:48

1 Answers1

0

I think this is may be similar to what you are wanting,

How to create Daylight Savings time Start and End function in SQL Server

see Jamie F's answer and adjust the code for your given timezone, his code is for the us time system so you will need to run through it and see where differences exist and adjust.

Using the SWITCHOFFSET ( DATETIMEOFFSET, time_zone ) function should help with the changes.

Joseph K
  • 17
  • 6
  • Thank you Joseph but not exactly what I wanted. Maybe my question was not very clear. I have amended the question just to make it a litter clearer. Thank you – Jeje Nov 30 '17 at 14:47