Retrieve the current date and time from the database system.
SELECT GETDATE(); |
The GETDATE() function returns the current date and time from the database system in the ‘YYYY-MM-DD hh:mm.mmm’ format.
Tip: Check out the CURRENT_TIMESTAMP function as well.
GETDATE() |
Return type: |
datetime |
Works in: |
SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |