What day is it?

Oopps! Upgrade your browser pretty please. Oopps! Upgrade your browser pretty please.

If you want to know what day it is, regardless of language and date settings in SQL server:


SET LANGUAGE 'Italiano'
SET DATEFIRST 3
SET DATEFORMAT ydm
SELECT CURRENT_TIMESTAMP as curtime,
(datepart(dw, CURRENT_TIMESTAMP)+@@datefirst-1)%7 as datepart,
CASE (datepart(dw, CURRENT_TIMESTAMP)+@@datefirst-1)%7
WHEN 1 THEN 'Monday'
WHEN 2 THEN 'Tuesday'
WHEN 3 THEN 'Wednesday'
WHEN 4 THEN 'Thursday'
WHEN 5 THEN 'Friday'
WHEN 6 THEN 'Saturday'
WHEN 0 THEN 'Sunday'
ELSE 'X-day'
END as Today