Friday, 9 March 2012

Sql Server Beginners : Various functions to get system date and time in Sql Server 2008

Here are varios functions to get system date and time.

SELECT SYSDATETIME() AS 'SYSDATETIME'
Output :-
2012-03-09 12:01:17.25

SELECT SYSDATETIMEOFFSET() AS 'SYSDATETIMEOFFSET'
Output :-
2012-03-09 12:01:17.2580000 +00:00

SELECT SYSUTCDATETIME() AS 'SYSUTCDATETIME'
Output :-
2012-03-09 12:01:17.25

SELECT CURRENT_TIMESTAMP AS 'CURRENT_TIMESTAMP'
Output :-
2012-03-09 12:01:17.257

SELECT GETDATE() AS 'GETDATE'
Output :-
2012-03-09 12:01:17.257

SELECT GETUTCDATE() AS 'GETUTCDATE'
Output :-
2012-03-09 12:01:17.257

No comments:

Post a Comment