Thursday, March 8, 2012

24 Hour

Looking for a way to convert (3/14/2006 4:13:28 PM) to military time.
dshttp://www.aspfaq.com/2464
Also, I strongly recommend against using the ambiguous m/d/yyyy format.
"Dave S." <davidstedman@.colliergov.net> wrote in message
news:eeoV1mESGHA.4300@.TK2MSFTNGP14.phx.gbl...
> Looking for a way to convert (3/14/2006 4:13:28 PM) to military time.
> ds
>|||Try something like this:
select convert(varchar, convert(datetime, '3/14/2006 4:13:28 PM'), 113)|||To convert (3/14/2006 4:13:28 PM) to military time, use:
select convert(varchar, convert(datetime, '3/14/2006 4:13:28 PM'), 108)
That will return this result: 16:13:28
******************************
To include the date with military time, use:
select convert(varchar, convert(datetime, '3/14/2006 4:13:28 PM'), 113)
That will return this result: 14 Mar 2006 16:13:28:000
Hope that helped,
TomB.
"Dave S." wrote:

> Looking for a way to convert (3/14/2006 4:13:28 PM) to military time.
> ds
>
>

No comments:

Post a Comment