Here are varios functions to get system date and time.
SELECT SYSDATETIME() AS 'SYSDATETIME'
Output :-
SELECT SYSDATETIMEOFFSET() AS 'SYSDATETIMEOFFSET'
Output :-
SELECT SYSUTCDATETIME() AS 'SYSUTCDATETIME'
Output :-
SELECT CURRENT_TIMESTAMP AS 'CURRENT_TIMESTAMP'
Output :-
SELECT GETDATE() AS 'GETDATE'
Output :-
SELECT GETUTCDATE() AS 'GETUTCDATE'
Output :-
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