Reputation: 5947
I have a datetime column in my table. How to I display only the time?
Say, the value in the column is 2013-03-25 08:40:00.000. How do I display the value 08:40 alone?
Thanks in advance.
Upvotes: 0
Views: 1213
Reputation: 32612
For SQL Server:
Since you don't want to show only time in hh:mm
format you can use this:
SELECT CONVERT(VARCHAR(5), GETDATE(), 8)
For more information see CAST and CONVERT (Transact-SQL)
For MySQL:
SELECT DATE_FORMAT(CURRENT_TIMESTAMP(), '%k:%i')
Upvotes: 0