current time sql server code example
Example 1: sql datetime now
SELECT GETDATE();
Example 2: sql server time stamp
SELECT CONVERT (DATE, SYSDATETIME())
,CONVERT (DATE, SYSDATETIMEOFFSET())
,CONVERT (DATE, SYSUTCDATETIME())
,CONVERT (DATE, CURRENT_TIMESTAMP)
,CONVERT (DATE, GETDATE())
,CONVERT (DATE, GETUTCDATE());
/* Returned
SYSDATETIME() 2007-05-03
SYSDATETIMEOFFSET()2007-05-03
SYSUTCDATETIME() 2007-05-04
CURRENT_TIMESTAMP 2007-05-03
GETDATE() 2007-05-03
GETUTCDATE() 2007-05-04
*/