Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Format time as "24-hour Military Time"?

I am updating some SQL Server 2000 code to SQL Server 2008R2, and there is function that looks a lot like this for converting the time into 24 hour format. What is a cooler/more clever way to do that in T-SQL?

like image 814
Snowy Avatar asked Sep 18 '25 10:09

Snowy


1 Answers

If all you want is just military time:

SELECT CONVERT(VARCHAR(8), GETDATE(), 108) AS MilitaryTime
like image 149
Mosquito Mike Avatar answered Sep 20 '25 08:09

Mosquito Mike