Reputation: 69
I want to show current date in following format. 9/16/2019 5:35:55 PM
select getdate()
Upvotes: 0
Views: 76
Reputation: 1522
declare @Date datetime =GETDATE()
select FORMAT(@Date,'MM/dd/yyyy hh:mm:s tt') AS CurrentDate
OR
Select Convert(char(10), getdate(),101) + Right(Convert(VarChar(20),getdate(),100),8)
You can use this Query...
Upvotes: 0
Reputation: 37473
You can use format()
SELECT FORMAT(getdate(), 'MM/dd/yyyy hh:mm:ss tt')
Upvotes: 1