Alex Rivera | Logout

Get the time of a datetime using T-SQL

Asked 2010-09-07T07:14:34.183
79

How can I get the time for a given datetime value?

I have a datetime in database like this:

2010-09-06 17:07:28.170

and want only the time portion:

17:07:28.170

Is there a function for that or something?

Edit
Report

1 Answer

10

Assuming the title of your question is correct and you want the time:

SELECT CONVERT(char,GETDATE(),14) 
answered 2010-09-07T07:18:44.420

Your Answer