0% found this document useful (0 votes)
20 views

DATE

This document contains Transact-SQL code that selects different date and time functions like SYSDATETIME(), GETDATE(), and CURRENT_TIMESTAMP, and converts the results to date and time data types.

Uploaded by

Debasis Bhuyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

DATE

This document contains Transact-SQL code that selects different date and time functions like SYSDATETIME(), GETDATE(), and CURRENT_TIMESTAMP, and converts the results to date and time data types.

Uploaded by

Debasis Bhuyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

SELECT SYSDATETIME()

,SYSDATETIMEOFFSET()
,SYSUTCDATETIME()
,CURRENT_TIMESTAMP
,GETDATE()
,GETUTCDATE();

SELECT CONVERT (date, SYSDATETIME())


,CONVERT (date, SYSDATETIMEOFFSET())
,CONVERT (date, SYSUTCDATETIME())
,CONVERT (date, CURRENT_TIMESTAMP)
,CONVERT (date, GETDATE())
,CONVERT (date, GETUTCDATE());

SELECT CONVERT (date, SYSDATETIME())


,CONVERT (date, SYSDATETIMEOFFSET())
,CONVERT (date, SYSUTCDATETIME())
,CONVERT (date, CURRENT_TIMESTAMP)
,CONVERT (date, GETDATE())
,CONVERT (date, GETUTCDATE());

SELECT CONVERT (time, SYSDATETIME())


,CONVERT (time, SYSDATETIMEOFFSET())
,CONVERT (time, SYSUTCDATETIME())
,CONVERT (time, CURRENT_TIMESTAMP)
,CONVERT (time, GETDATE())
,CONVERT (time, GETUTCDATE());

SELECT SYSDATETIME()
,CURRENT_TIMESTAMP
,GETDATE();

SELECT CONVERT (date, SYSDATETIME())


,CONVERT (date, CURRENT_TIMESTAMP)
,CONVERT (date, GETDATE());

SELECT CONVERT (time, SYSDATETIME())


,CONVERT (time, CURRENT_TIMESTAMP)
,CONVERT (time, GETDATE());

You might also like