sql server - 12 hr time format in sql like.. 02:32:00 PM -


how can time 02:32:00 pm in sql server?

i can 24 hr following code.

convert(varchar(26), getdate(), 108) 

but want pure hh:mm:ss tt not milliseconds.

i found 1 milliseconds.

select convert(varchar, getdate(), 109) 

how achieve that?

select right('0' + ltrim(stuff(right(convert(char(26), current_timestamp, 109), 14),9, 4, ' ')),11) 

Comments

Popular posts from this blog

java - SNMP4J General Variable Binding Error -

windows - Python Service Installation - "Could not find PythonClass entry" -

Determine if a XmlNode is empty or null in C#? -