SELECT CONVERT(VARCHAR(10), getdate(), 101);
Outputs in mm/dd/yyyy

SELECT CAST(getdate() AS date);

To get the current date time:

SELECT getdate();

SELECT CURRENT_TIMESTAMP;

Other related functions:
ELECT CONVERT (time, SYSDATETIME())
,CONVERT (time, SYSDATETIMEOFFSET())
,CONVERT (time, SYSUTCDATETIME())
,CONVERT (time, CURRENT_TIMESTAMP)
,CONVERT (time, GETDATE())
,CONVERT (time, GETUTCDATE());

/* Returned
SYSDATETIME() 13:18:45.3490361
SYSDATETIMEOFFSET()13:18:45.3490361
SYSUTCDATETIME() 20:18:45.3490361
CURRENT_TIMESTAMP 13:18:45.3470000
GETDATE() 13:18:45.3470000
GETUTCDATE() 20:18:45.3470000
*/

Categories: SQL Server