Friday, August 30, 2019

Check SQL Server system Date and Time


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:

  1. Current TIME in the 24-hour format hh:mi:ss

SELECT CONVERT(VARCHAR(8), GETDATE(), 108) 'hh:mi:ss'


  1. Current TIME in the 24-hour format hh:mi:ss:mmm

SELECT CONVERT(VARCHAR(12),GETDATE(),114) 'hh:mi:ss:mmm'


  1. 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)'


1 comment:

  1. Where To Play in Las Vegas | DrmCD
    Find the best Las Vegas casinos 진주 출장안마 with 양주 출장안마 fast payouts 김포 출장샵 with our detailed guide. Top 계룡 출장마사지 MGM Grand Casino Slots & Video 대전광역 출장마사지 Poker Games · Best Casinos in Las Vegas.

    ReplyDelete