Skip to content
  • There are no suggestions because the search field is empty.

T SQL Script: UK‑time helper function automatically applies GMT and BST changes.

T SQL Script: UK‑time helper function automatically applies GMT and BST changes.

CREATE FUNCTION dbo.GetUKLocalTime()
RETURNS datetime2
AS
BEGIN
    RETURN CAST(SYSDATETIMEOFFSET() 
                AT TIME ZONE 'UTC' 
                AT TIME ZONE 'GMT Standard Time' AS datetime2);
END;
GO