Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get current time without Date

Tags:

sql

sybase

How do I get the current time only?

select getdate()

Gives me:

Dec 16 2016  5:41PM

I want this result:

5:41PM
like image 812
Moudiz Avatar asked Dec 16 '16 15:12

Moudiz


2 Answers

You can convert the GETDATE() results to a TIME datatype to pull the current time:

Select Convert(Time, GetDate())
like image 52
Siyual Avatar answered Nov 19 '22 04:11

Siyual


You can do that pretty simply; if I correctly understood your problem.

SELECT CAST('INSERT THE TIME HERE' AS TIME(0))
like image 2
T. K. Avatar answered Nov 19 '22 03:11

T. K.