0
Today I have the following situation, I need to send the current date and time of the request in an int format, as image below
Below are some attempts I made, but when testing the conversion to date for validation of the result, returned an inconsistent date.
cast(GETDATE() as bigint)
CAST((convert(datetime,getdate(),108))
Imex, how can I use only the column that returned the entire data? put an alias for it?
– Gabriel Paixão Justino
I don’t know if I understand this correctly, but try something like this:
select
 datediff
 (second, 
 dateadd(hour, datediff(hour, getutcdate(), getdate()), '19700101'), 
 getdate()) as Tempo
– imex
That’s right, perfect!
– Gabriel Paixão Justino