I want to convert my date time format in sql to 24 hr time
in short i want time (24 hr format) from datetime column
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
Nitin SontakkeRank #264 · 9.6K reputationPosted Sep 8, 2016, 5:27 AM EDT
Midhun TpRank #388 · 6.5K reputationPosted Sep 8, 2016, 6:16 AM EDT
select convert(varchar(5),colname,108) as [time] from yourtable
Bikesh SrivastavaRank #108 · 20.3K reputationPosted Sep 12, 2016, 10:16 PM EDT
Example -
Query (24 hour format):
Select Format(cast('2016-03-03 23:59:59' as datetime),'dd-MMM-yyyy HH:mm:ss','en-us'). ('HH:mm:ss' in Capital letters)Result
Tapan PatelRank #614 · 3.9K reputationPosted Sep 12, 2016, 7:22 AM EDT