SQL Server 2005 Military Time

Charles Baldo
Charles Baldo used Ask the Experts™
on
Can anyone tell me how to do military time in sql server 2005 all columns are date time
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Senior .Net Developer
Commented:
SELECT CONVERT(CHAR(8),GETDATE(),14) -- hh:mm:ss

SELECT CONVERT(CHAR(30),GETDATE(),14) -- hh:mm:ss:miliseconds.

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

CONVERT(varchar(12), DateField, 114)
Steve WalesSenior Database Administrator

Commented:
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.
Charles BaldoSoftware Developer

Author

Commented:
Thanks

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial