Get the database time sql server formatted

1

My database has a difference of 4 hours, support so far has not given a solution, so I would like to know how I can format the time out:

select 
CAST(HORA_FECHAMENTO AS datetime) as HORA_FECHAMENTO,
CONVERT(VARCHAR(05), DATEADD(hour, +4, getdate()), 108) AS 'HORA'
from TB_ESTRACAO 
where ID > 0

Output:

1900-01-01 11:00:00.000 | 15:29

I need it to look like this:

11:00 | 15:29

    
asked by anonymous 14.07.2016 / 16:34

1 answer

2

It's just the sign of + you do not need. The rest is right.

select CONVERT(VARCHAR(5), CAST(HORA_FECHAMENTO AS datetime), 108) as HORA_FECHAMENTO,
CONVERT(VARCHAR(5), DATEADD(hour, 4, getdate()), 108) AS 'HORA'
from TB_ESTRACAO 
where ID > 0
    
14.07.2016 / 16:39