Using below commands you can check SQL server date and time.
Open query browser and type the following commands. And when you execute it output will come out.
Command : 1
Select CURRENT_TIMESTAMP;

Command : 2
Select SYSDATETIME();

In below Results column its show the current Date and Time.
Current TIME in Various Formats
Below are the examples of current TIME in various formats:
- Current TIME in the 24-hour format hh:mi:ss
SELECT CONVERT(VARCHAR(8), GETDATE(), 108) ‘hh:mi:ss’

- Current TIME in the 24-hour format hh:mi:ss:mmm
SELECT CONVERT(VARCHAR(12),GETDATE(),114) ‘hh:mi:ss:mmm’

- Current TIME in the 12-hour format hh:mi:ss:mmmAM
SELECT RIGHT(CONVERT(VARCHAR(26), GETDATE(), 109),14)
‘hh:mi:ss:mmmAM (or PM)’

Click to rate this post!
[Total: 0 Average: 0]