get parts of time sql code example
Example 1: get hour from date sql
SELECT DATEPART(HOUR, GETDATE());
Example 2: get time component of datetime sql
SELECT convert(varchar(8), getdate(), 108)
SELECT DATEPART(HOUR, GETDATE());
SELECT convert(varchar(8), getdate(), 108)