MSSQL Date/Time Functions
18 functions
GETDATEGETDATE()Returns the current date and time.
GETUTCDATEGETUTCDATE()Returns the current UTC date and time.
SYSDATETIMESYSDATETIME()Returns the current date and time with high precision.
CURRENT_TIMESTAMPCURRENT_TIMESTAMPReturns the current date and time (equivalent to GETDATE()).
DATEADDDATEADD(unit, n, date)Adds an interval to a date.
DATEDIFFDATEDIFF(unit, d1, d2)Returns the difference between two dates in the specified unit.
DATEDIFF_BIGDATEDIFF_BIG(unit, d1, d2)DATEDIFF that can handle large values.
DATENAMEDATENAME(unit, date)Returns the specified part of a date as a string.
DATEPARTDATEPART(unit, date)Returns the specified part of a date as an integer.
DAYDAY(date)Returns the day.
MONTHMONTH(date)Returns the month.
YEARYEAR(date)Returns the year.
DATEFROMPARTSDATEFROMPARTS(y, m, d)Creates a DATE from year, month, and day.
EOMONTHEOMONTH(date [, n])Returns the last day of the month (or n months later).
FORMATFORMAT(date, format [, culture])Formats a date as a specified format string.
CONVERTCONVERT(data_type, expr [, style])Converts a value to a target type (with date format style).
ISDATEISDATE(str)Returns whether a string is a valid date.
SWITCHOFFSETSWITCHOFFSET(dt_offset, tz)Converts a timestamp's time zone offset.
