CREATE FUNCTION GetLocalDate() RETURNS DATETIME AS BEGIN DECLARE @bjdate DATETIME; SELECT @bjdate=SWITCHOFFSET(SYSDATETIMEOFFSET(), '+08:00'); RETURN @bjdate; END