Curriculum
Course: SQL
Login

Curriculum

SQL

SQL References

0/80

MySQL Functions

0/139

SQL Server Functions

0/84

SQL Quick Ref

0/1
Text lesson

SYSDATETIME

Example

Retrieve the current date and time from SQL Server.

SELECT SYSDATETIME() AS SysDateTime;

Definition and Usage

The SYSDATETIME() function provides the current date and time based on the system clock of the SQL Server instance.

Syntax

SYSDATETIME()

Technical Details

Return type:

Datetime2(7)

Works in:

 SQL Server (from 2008 onward), Azure SQL Database, Azure SQL Data Warehouse, and Parallel Data Warehouse