datediff() function in SQL Server to get date difference in days hours minutes, years, month between two dates or calculate datediff in SQL Server in days hours minutes format.