# script: scripts/12a_waitfor_time_local.sql | database: lab-cst | started (UTC): 2026-10-16 01:50:15 /* 12a - WAITFOR TIME with a LOCAL (Central) target 5 seconds ahead (CST database) If WAITFOR TIME interprets the target in the effective (Central) zone, this returns in ~5 s. If it interprets it as UTC, it would wait ~19 hours and the runner's 30 s query timeout fires. */ SET NOCOUNT ON; PRINT '=== 12a WAITFOR TIME local target on ' + DB_NAME() + ' (effective tz: ' + CURRENT_TIMEZONE_ID() + ')'; DECLARE @target varchar(12) = CONVERT(varchar(12), DATEADD(SECOND, 5, GETDATE()), 114); DECLARE @t0 datetime2(3) = SYSUTCDATETIME(); SELECT @target AS waitfor_target_local, GETDATE() AS local_now, GETUTCDATE() AS utc_now; WAITFOR TIME @target; SELECT 'returned' AS result, DATEDIFF(MILLISECOND, @t0, SYSUTCDATETIME()) AS waited_ms; Timeout expired # sqlcmd exit code: 0