T-SQL Tutorial

T-SQL SysDateTime - Date Function


The T-SQL SysDateTime is an date function and returns a datetime2 value of the computer on which the instance of SQL Server is running.

SysDateTime Syntax:

SYSDATETIME()

SysDateTime Example:

SELECT CONVERT (date, SYSDATETIME()) as Date,
CONVERT (time, SYSDATETIME()) as Time,
SYSDATETIME() as SysDateTime;

DateTimeSysDateTime
2014-03-0116:18:57.32034772014-03-01 16:18:57.3203477