Get Local Date Time
CREATE FUNCTION [dbo].[ufn_utl_GetLocalDateTime]
(
@StartDate DATETIME
)
RETURNS DATETIME
AS
BEGIN
RETURN (DATEADD(
HOUR,
(CAST(DATEPART(HOUR, SYSDATETIME()) AS INT) - CAST(DATEPART(HOUR, SYSUTCDATETIME()) AS INT)),
@StartDate
)
);
END;
GO
Comments
Post a Comment