Date Functions Overview
SQL provides a rich set of functions for retrieving and manipulating date and time values. Below is a curated list of the most commonly used date functions.
Function List
- DATEADD – Adds a specified number interval to a date.
- DATEDIFF – Returns the count of the specified datepart boundaries crossed between two dates.
- DATEPART – Returns an integer representing the specified part of a date.
- FORMAT – Returns a value formatted with the specified format and optional culture.
- GETDATE – Returns the database server’s current date and time.
- SYSDATETIME – Returns the database server’s date and time with higher precision.
- CONVERT – Converts an expression of one data type to another. Often used for date formatting.
- TRY_CONVERT – Safely converts an expression; returns NULL on failure.
- PARSE – Parses a string to a date/time value using culture-specific format.
- DATEDIFF_BIG – Same as DATEDIFF but returns BIGINT for large intervals.