Retrieve the current date and time from SQL Server.
SELECT SYSDATETIME() AS SysDateTime; |
The SYSDATETIME() function provides the current date and time based on the system clock of the SQL Server instance.
SYSDATETIME() |
Return type: |
Datetime2(7) |
Works in: |
SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse |