Hi,
I want to get time in hh:mi:ss.mmm format in SQL Server.... Please help.
Thank You...
How to get time in hh:mi:ss.mmm format
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jaganathan BantheswaranRank #170 · 14.1K reputationPosted Sep 22, 2011, 8:49 PM EDT
Try like this
SELECT LTRIM(RIGHT(CONVERT(VARCHAR(24), GETDATE(), 113), 12))
AS HourMinuteSecond
GO
Pravin MoreRank #1,419 · 1.2K reputationPosted Sep 22, 2011, 9:01 PM EDT
You can get it by thuis way..............
select convert(varchar, getdate(), 114)
Output is like : 10:30:00:780
i hope it will work for you.
Thanx,
Pravin.