In the application I have a query that compares the current time of the server with a pre-set timetable recorded in a table:
select CAST(HORA_FECHAMENTO AS datetime) as HORA_FECHAMENTO,
CAST(CONVERT(VARCHAR(11),GETDATE(),8) as datetime) as HORA_ATUAL
from TB_ESTRACAO
where IDEXTRACAO = 1
When I send this information to the screen I am formatting it as follows:
Session["hora_atual_servidor"] = String.Format("{0:T}", retornoHoraAtual.HORA_ATUAL);
Session["hora_final_valida"] = String.Format("{0:T}", retornoHoraAtual.HORA_FECHAMENTO);
The application running on the local machine shows me the information:
Ontheserver,theinformationlookslikethis:
To complete the server returns me the wrong time with a difference of almost 40 minutes unless the current time is when it is 10:00 PM shows as 10:00 PM, how could I solve this problem?