T-SQL Date and Time Functions: SYSDATETIME and SYSUTCDATETIME, DATEADD, DATEDIFF, EOMONTH, DATEFROMPARTS and AT TIME ZONE
T-SQL date functions are sensitive to session settings and types: in a Turkish session '2026-04-03' becomes March 4 as DATETIME, and DATEDIFF counts boundaries, not durations, always starting weeks on Sunday. With real output and PostgreSQL counterparts we cover SYSUTCDATETIME, EOMONTH, DATEFROMPARTS, ISO_WEEK, the .997 trap of BETWEEN, two-step AT TIME ZONE from UTC to Istanbul time and DST transitions.
15 Nov 2026
·
16 min
·
9