Date and Time Functions

Learn about date and time functions.

All applications work with date and time at some point. Fortunately, we do not have to reinvent the wheel and write our own functions when working with date and time in MS SQL Server. T-SQL has a number of functions for this purpose.

Current date and time

We can check the current date and time by looking at the system clock. The GETDATE() function returns an object of type DATETIME, which will show the local date and time according to the system clock:

Get hands-on with 1200+ tech skills courses.