[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 609
  • Last Modified:

SQL Server 2005 Military Time

Can anyone tell me how to do military time in sql server 2005 all columns are date time
0
Charles Baldo
Asked:
Charles Baldo
1 Solution
 
Kyle AbrahamsSenior .Net DeveloperCommented:
SELECT CONVERT(CHAR(8),GETDATE(),14) -- hh:mm:ss

SELECT CONVERT(CHAR(30),GETDATE(),14) -- hh:mm:ss:miliseconds.
0
 
tim_csCommented:
Try convert.  http://msdn.microsoft.com/en-us/library/ms187928.aspx

CONVERT(varchar(12), DateField, 114)
0
 
Steve WalesSenior Database AdministratorCommented:
All the various date options for CONVERT for date are here:

http://msdn.microsoft.com/en-us/library/ms187928.aspx

Take your pick for the one you need.
0
 
Charles BaldoSoftware DeveloperAuthor Commented:
Thanks
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now